• Intro Headers Instructions Macros Commands
  • Fork me on GitHub
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Project Setup
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Bundle Annotations
    • Accessor Properties
    • SPI Annotations
    • Resolving Dependencies
    • Launching
    • Startlevels
    • Testing
    • Testing with Launchpad
    • Packaging Applications
    • JPMS Libraries
    • Wrapping Libraries to OSGi Bundles
    • Generating Documentation
    • Commands
    • For Developers
    • Tips for Windows users
    • Tools bound to bnd
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • External Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • toclassname ';' FILES

    static String	_toclassnameHelp	= "${classname;<list of class names>}, convert class paths to FQN class names ";
    
    public String _toclassname(String args[]) {
    	verifyCommand(args, _toclassnameHelp, null, 2, 2);
    	Collection<String> paths = Processor.split(args[1]);
    
    	List<String> names = new ArrayList<String>(paths.size());
    	for (String path : paths) {
    		if (path.endsWith(".class")) {
    			String name = path.substring(0, path.length() - 6).replace('/', '.');
    			names.add(name);
    		} else if (path.endsWith(".java")) {
    			String name = path.substring(0, path.length() - 5).replace('/', '.');
    			names.add(name);
    		} else {
    			domain.warning("in toclassname, " + args[1] + " is not a class path because it does not end in .class");
    		}
    	}
    	return Processor.join(names, ",");
    }
    
    • GitHub