public ClassPath(IModule module, ClassPathFilter filter) { _module = module; _filter = filter; // Files are assumed stable outside an IDE _fs = CommonServices.getFileSystem(); _bStableFiles = _fs instanceof FileSystemImpl; loadClasspathInfo(); }
@Override public IFile file(String path) { // try { File subFile = new File(this._file, path)/*.getCanonicalFile()*/; return CommonServices.getFileSystem().getIFile(subFile); // } catch (IOException e) { // throw new RuntimeException(e); // } }
@Override public IDirectory getParent() { File parentFile = _file.getParentFile(); if (parentFile == null) { return null; } else { return CommonServices.getFileSystem().getIDirectory(parentFile); } }
@Override public IDirectory apply(File file) { return CommonServices.getFileSystem().getIDirectory(file); } }
@Override public IDirectory dir(String relativePath) { // try { File subDir = new File(this._file, relativePath)/*.getCanonicalFile()*/; return CommonServices.getFileSystem().getIDirectory(subDir); // } catch (IOException e) { // throw new RuntimeException(e); // } }
public static List<IDirectory> toDirectories(List<String> paths) { List<IDirectory> dirs = new ArrayList<IDirectory>(); for (String path : paths) { dirs.add(CommonServices.getFileSystem().getIDirectory(new File(path))); } return dirs; }
@Override public IDirectory getParent() { File parentFile = _file.getParentFile(); if (parentFile != null) { return CommonServices.getFileSystem().getIDirectory(parentFile); } else { return null; } }
@Override public IDirectory getParent() { File parentFile = _file.getParentFile(); if (parentFile == null) { return null; } else { return CommonServices.getFileSystem().getIDirectory(parentFile); } }
@Override public IDirectory getParent() { File parentFile = _file.getParentFile(); if (parentFile != null) { return CommonServices.getFileSystem().getIDirectory(parentFile); } else { return null; } }
@Override public List<? extends IDirectory> listDirs() { List<IDirectory> results = new ArrayList<IDirectory>(); File[] files = _file.listFiles(); if (files != null) { for (File f : _file.listFiles()) { if (FileSystemImpl.isDirectory(f)) { results.add(CommonServices.getFileSystem().getIDirectory(f)); } } } return results; }
@Override public String getResourceName(URL url) { IFile file = CommonServices.getFileSystem().getIFile(url); String resourceName = _module.pathRelativeToRoot(file); if (resourceName == null) { throw new RuntimeException("Could not find resource " + url); } return resourceName; }
/** * DO NOT USE OR DELETE. Called form the debugging process (IDE). * @param filePaths */ public static void refreshedFiles(String[] filePaths) { for (String filePath : filePaths) { IFile file = CommonServices.getFileSystem().getIFile(new File(filePath)); if (file != null) { TypeSystem.refreshed(file); } } }
/** * DO NOT USE OR DELETE. Called form the debugging process (IDE). * @param filePaths */ public static void refreshedFiles(String[] filePaths) { for (String filePath : filePaths) { IFile file = CommonServices.getFileSystem().getIFile(new File(filePath)); if (file != null) { TypeSystem.refreshed(file); } } }
public void setFilePath( String filePath ) { if( filePath != null ) { _file = CommonServices.getFileSystem().getIFile( new File( filePath ) ); assignFileRef(); } }
public void setFilePath( String filePath ) { if( filePath != null ) { _file = CommonServices.getFileSystem().getIFile( new File( filePath ) ); assignFileRef(); } }
@Override public IFile[] getSourceFiles() { ISourceFileHandle sourceFileHandle = getSourceFileHandle(); String filePath = sourceFileHandle == null ? null : sourceFileHandle.getFilePath(); if (filePath != null) { return new IFile[] {CommonServices.getFileSystem().getIFile(new File(filePath))}; } else { return NO_FILES; } }
@Override public IFile[] getSourceFiles() { ISourceFileHandle sourceFileHandle = getSourceFileHandle(); String filePath = sourceFileHandle == null ? null : sourceFileHandle.getFilePath(); if (filePath != null) { return new IFile[] {CommonServices.getFileSystem().getIFile(new File(filePath))}; } else { return IFile.EMPTY_ARRAY; } }
public static LabFrame create() { GosuLabLAF.setLookAndFeel(); CommonServices.getFileSystem().setCachingMode( IFileSystem.CachingMode.NO_CACHING ); return new LabFrame(); }
public static BasicGosuEditor create() { GosuWindowsLAF.setLookAndFeel(); CommonServices.getFileSystem().setCachingMode( IFileSystem.CachingMode.NO_CACHING ); return new BasicGosuEditor(); } }
@Override public IFile[] getSourceFiles() { if (getSourceFileHandle() == null) { return NO_FILES; } else { File file = new File(getSourceFileHandle().getFilePath()); return new IFile[]{CommonServices.getFileSystem().getIFile(file)}; } }