public static String getPackageName(FileObject folder) { return ClassPath.getClassPath( folder, ClassPath.SOURCE) .getResourceName(folder, '.', false); }
protected void releaseProjectClassLoader() { if (classLoader != null) { classLoader = null; } if (classPath != null) { classPath.removePropertyChangeListener(classPathListener); classPathListener = null; classPath = null; } }
public static FileObject getClassPathRoot(FileObject fileObject) { return ClassPath.getClassPath(fileObject, ClassPath.SOURCE).findOwnerRoot(fileObject); }
public SpringIndex(FileObject fo) { this.binaryRoots = (ClassPath.getClassPath(fo, ClassPath.EXECUTE).getRoots()); }
private FileObject findFile(String resourcePath) { return GlobalPathRegistry.getDefault().findResource(resourcePath); }
@SuppressWarnings("LeakingThisInConstructor") public FR (final ClassPath.Entry entry) { assert entry != null; this.support = new PropertyChangeSupport(this); this.entry = entry; this.classPath = entry.getDefiningClassPath(); this.classPath.addPropertyChangeListener(WeakListeners.propertyChange(this, classPath)); this.cache = new URL[] {entry.getURL()}; }
public FileObject find(String filename) { return classpath.findResource(filename); }
FileObject getSourceFileObject(){ FileObject[] roots = mySourcePath.getRoots(); if ( roots!= null && roots.length >0 ){ return roots[0]; } return null; }
private FileObject[] findFile (final String relativePath) { for (ClassPath.Entry entry : this.sourceRoots.entries()) { if (ignoreExcludes || entry.includes(relativePath)) { FileObject root = entry.getRoot(); if (root != null) { FileObject file = root.getFileObject(relativePath); if (file != null) { return new FileObject[] {file, root}; } } } } return null; }
public static String getPackageName(FileObject folder) { ClassPath cp = ClassPath.getClassPath(folder, ClassPath.SOURCE); if (cp != null) { return cp.getResourceName(folder, '.', false); } return null; }
FileObject getSourceFileObject() { FileObject[] roots = sourcePath.getRoots(); if (roots != null && roots.length > 0) { return roots[0]; } return null; }
/** * @return corresponding class name for given source file */ static String getClassNameForFile(FileObject fo) { ClassPath cp = ClassPath.getClassPath(fo, ClassPath.SOURCE); return cp != null ? cp.getResourceName(fo, '.', false) : null; }
public SpringIndex(ClassPath cp) { this.binaryRoots = cp.getRoots(); }
private static String getClassName(FileObject fileObj) { //PENDING: is it ensured that the classpath is non-null? return ClassPath.getClassPath(fileObj, ClassPath.SOURCE) .getResourceName(fileObj, '.', false); }
public static URL[] getClassPathRoots (final ClassPath cp) { assert cp != null; final List<ClassPath.Entry> entries = cp.entries(); final List<URL> result = new ArrayList<URL>(entries.size()); for (ClassPath.Entry entry : entries) { result.add (entry.getURL()); } return result.toArray(new URL[result.size()]); }