public FileObject getFileObject(String name, String ext) { return fileObj.getFileObject(name, ext); }
@Override public FileObject getFileObject(String name, String ext) { if (maskFile.isFolder()) { return maskFile.getFileObject(name, ext); } else { return null; } }
@Override public FileObject getFileObject(String relativePath) { if (maskFile.isFolder()) { return maskFile.getFileObject(relativePath); } else { return null; } }
myObj = myObj.getFileObject("//"+st.nextToken()+"/"+st.nextToken(), null); } else { if (!nameExt.equals(".")) { myObj = myObj.getFileObject(nameExt, null);
/** Test whether there is a file with the same basename and only a changed extension in the same folder. * The default implementation asks this file's parent using {@link #getFileObject(String name, String ext)}. * * @param ext the alternate extension * @return true if there is such a file */ public boolean existsExt(String ext) { FileObject parent = getParent(); return (parent != null) && (parent.getFileObject(getName(), ext) != null); }
FileObject f = folder.getFileObject(name); f = folder.getFileObject(name);
/** Finds brother file with same base name but different extension. * @param fo the file to find the brother for or <CODE>null</CODE> * @param ext extension for the brother file * @return a brother file (with the requested extension and the same parent folder as the original) or * <CODE>null</CODE> if the brother file does not exist or the original file was <CODE>null</CODE> */ public static FileObject findBrother(FileObject fo, String ext) { if (fo == null) { return null; } FileObject parent = fo.getParent(); if (parent == null) { return null; } return parent.getFileObject(fo.getName(), ext); }
data = folder.getFileObject(fname, ext); data = folder.getFileObject(fname, ext);
} else { if (ext == null) { fo = fo.getFileObject(name); fo = fo.getFileObject(name, ext);
/** Copies content of one folder into another. * @param source source folder * @param target target folder * @exception IOException if it fails */ private static void copyContent(FileObject source, FileObject target) throws IOException { FileObject[] srcArr = source.getChildren(); copyAttrs(source, target); //added for (int i = 0; i < srcArr.length; i++) { FileObject child = srcArr[i]; if (MultiFileSystem.isMaskFile(child)) { continue; } if (target.getFileObject(child.getName(), child.getExt()) == null) { if (child.isData()) { FileObject fo = FileUtil.copyFile(child, target, child.getName(), child.getExt()); if (fo != null) { copyAttrs(child, fo); } } else { FileObject targetChild = target.createFolder(child.getName()); copyContent(child, targetChild); } } } }
private String getFolderName(FileObject baseFolder, String libraryName) { int suffix = 2; String baseName = libraryName; //NOI18N String name = baseName; while (baseFolder.getFileObject(name) != null) { name = baseName + "-" + suffix; // NOI18N suffix++; } return name; }
private static void addFile(FileObject projectDirectory, String fileName, List<FileObject> result) { FileObject file = projectDirectory.getFileObject(fileName); if (file != null) { result.add(file); } }
private static void addFile(FileObject projectDirectory, String fileName, List<FileObject> result) { FileObject file = projectDirectory.getFileObject(fileName); if (file != null) { result.add(file); } }
@Override public JavaFileObject getFile(String name) throws IOException { final FileObject file = root.getFileObject(name); return file == null ? null : FileObjects.sourceFileObject(file, root, null, false); }
public FileObject[] findSourceFile(String distributionPath) { ArrayList ret = new ArrayList(); FileObject[] roots = getSourceRoots(); String path = distributionPath.startsWith("/") ? distributionPath.substring(1) : distributionPath; //NOI18N for (int i=0; i<roots.length; i++) { FileObject fo = roots[i].getFileObject(path); if (fo != null) ret.add(fo); } return (FileObject[]) ret.toArray(new FileObject[ret.size()]); }
public List<String> keys() { List<String> result = new ArrayList<String>(); if (project.getProjectDirectory().getFileObject("setup") != null) { // NOI18N result.add(SETUP_DIR); } return result; }
@Override protected boolean reloadStream() { FileObject fo = project.getProjectDirectory().getFileObject(FILENAME_PREFIX + id + FILENAME_SUFFIX); boolean prevExists = lastTimeExists; lastTimeExists = fo != null; return ((fo == null && prevExists) || (fo != null && fo.lastModified().after(lastModified))); }
/* package */ static boolean existFileName(FileObject targetFolder, String relFileName) { if (targetFolder.isValid()) { FileObject fo = targetFolder.getFileObject (relFileName); return fo != null && fo.isValid(); } return false; }
public void run () throws IOException { FileObject file = folder.getFileObject (filename, ext); if (file == null) file = folder.createData (filename, ext); writeDocument (file, doc); } });
private static String detectCMake(FileObject folder){ if (folder == null) { return null; } FileObject configure = folder.getFileObject("CMakeLists.txt"); // NOI18N if (configure != null && configure.isValid()) { if (AbstractExecutorRunAction.findTools("cmake") != null) { // NOI18N return configure.getPath(); } } return null; }