Refine search
void locateCurrent() { FileObject oldCurrent = current; currentF = FileUtil.normalizeFile(path); while (true) { current = FileUtil.toFileObject(currentF); if (current != null) { isOnTarget = path.equals(currentF); break; } currentF = currentF.getParentFile(); if (currentF == null) { // #47320: can happen on Windows in case the drive does not exist. // (Inside constructor for Holder.) In that case skip it. return; } } assert current != null; if (current != oldCurrent) { if (oldCurrent != null) { oldCurrent.removeFileChangeListener(this); } current.addFileChangeListener(this); current.getChildren(); //to get events about children } }
private void setJarFile(final File aRoot, boolean refreshRoot, boolean openJar) throws IOException, PropertyVetoException { if (!aRoot.equals(FileUtil.normalizeFile(aRoot))) { throw new IllegalArgumentException( "Parameter aRoot was not " + // NOI18N "normalized. Was " + aRoot + " instead of " + FileUtil.normalizeFile(aRoot) setJar(tempJar); openRequestTime = System.currentTimeMillis(); root = new File(s); foRoot = FileUtil.toFileObject(root);
public static File convertStringToFile(String str) { if (str != null) { File fil = new File(str); return FileUtil.normalizeFile(fil); } return null; }
/** * Returns the administrative hg folder for the given repository and normalizes the file * @param repositoryRoot root of the repository * @return administrative hg folder */ public static File getHgFolderForRoot (File repositoryRoot) { return FileUtil.normalizeFile(new File(repositoryRoot, HG_FOLDER_NAME)); }
public static FileObject convertStringToFileObject(String str) { if (str != null) { File fil = new File(str); fil = FileUtil.normalizeFile(fil); return FileUtil.toFileObject(fil); } return null; }
public LocalFileDiffStreamSource (File file, boolean isRight) { this.file = FileUtil.normalizeFile(file); this.fileObject = FileUtil.toFileObject(this.file); this.isRight = isRight; }
private File getNormalizedFile(String path) { if (path == null) { return null; } return FileUtil.normalizeFile(new File(path)); }
@Override public Collection<FileObject> getInstallFolders() { String prop = System.getProperty("java.home"); //NOI18N File f = FileUtil.normalizeFile (new File (prop)); return Collections.<FileObject>singleton(FileUtil.toFileObject(f)); }
/** * Sets the file for which the annotations are displayed. This file can differ from the displayed one when showing annotations * for a file in the past. * @param file */ void setReferencedFile(File file) { this.referencedFile = FileUtil.normalizeFile(file); this.referencedFileObject = FileUtil.toFileObject(file); } }
public static URI convertStringToUri(String str) { if (str != null) { File fil = new File(str); fil = FileUtil.normalizeFile(fil); return fil.toURI(); } return null; }
public static FileObject[] convertStringsToFileObjects(List<String> strings) { FileObject[] fos = new FileObject[strings.size()]; int index = 0; Iterator<String> it = strings.iterator(); while (it.hasNext()) { String str = it.next(); File fil = new File(str); fil = FileUtil.normalizeFile(fil); fos[index] = FileUtil.toFileObject(fil); index++; } return fos; }
/** * Normalizes the given file and return a FileObject * @param file * @return */ public static FileObject toFileObject(File file) { File nfile = FileUtil.normalizeFile(file); if(nfile != null) { return FileUtil.toFileObject(nfile); } else { return FileUtil.toFileObject(file); } }
/** * the location of ${user.home}/.m2 */ public File getM2UserDir() { return FileUtil.normalizeFile(new File(System.getProperty("user.home"), ".m2")); }
private FileObject createLibrariesFolder() { int i = 0; for (;;) { File tmpDir = new File(System.getProperty("java.io.tmpdir"), "netbeans-jslibs-" + i++); // NOI18N if (!tmpDir.isDirectory() && tmpDir.mkdirs()) { FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(tmpDir)); if (fo != null && fo.isValid()) { return fo; } } } }
public FileObject getRootFolder() { FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(art.getFile())); if (fo != null) { return FileUtil.getArchiveRoot(fo); } return null; }
/** * the location of ${user.home}/.m2 */ public File getM2UserDir() { return FileUtil.normalizeFile(new File(System.getProperty("user.home"), ".m2")); }
private void selectAbsoluteResource(Matcher m) { String resource = "/" + m.group(1) + m.group(4); //NOI18N int lineNumber = Integer.parseInt(m.group(5)); File file = new File(resource); if (file.exists()) { FileObject source = FileUtil.toFileObject(FileUtil.normalizeFile(file)); doOpen(source, lineNumber); } }
private void addFiles(List<File> files) throws IOException { for( File file : files ) { final FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(file.getAbsoluteFile())); if (fo == null) { throw new IOException("no file object for " + file); // NOI18N } else { addFile(fo); } } }
/** * Location in user directory of per-user global properties. * May be null if <code>netbeans.user</code> is not set. */ static File userBuildProperties() { String nbuser = System.getProperty("netbeans.user"); // NOI18N if (nbuser != null) { return FileUtil.normalizeFile(new File(nbuser, "build.properties")); // NOI18N } else { return null; } }
@Override protected FileObject getTargetFO(String fileName, FileObject sourceFO) { File targetFile = new File(getTargetFilePath(fileName, sourceFO)); FileObject targetFO = FileUtil.toFileObject(FileUtil.normalizeFile(targetFile)); // do not navigate to itself if (sourceFO.equals(targetFO)) { return null; } return targetFO; }