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 FileObject convertURItoFileObject(URI uri) { if (uri == null) { return null; } File fil = new File(uri); return FileUtil.toFileObject(fil); }
FileObject getSelectedLocation() { return FileUtil.toFileObject(new File(locationText.getText())); }
public static FileObject convertStringToFileObject(String str) { if (str != null) { File fil = new File(str); fil = FileUtil.normalizeFile(fil); return FileUtil.toFileObject(fil); } return null; }
/** * 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); } }
public Collection<FileObject> getInstallFolders() { return Collections.singleton(FileUtil.toFileObject(new File(System.getProperty("scala.home")))); // NOI18N }
@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)); }
public LocalFileDiffStreamSource (File file, boolean isRight) { this.file = FileUtil.normalizeFile(file); this.fileObject = FileUtil.toFileObject(this.file); this.isRight = isRight; }
public File getDistributionPath(FileObject sourceFile) { for (Iterator i=rootFiles.iterator(); i.hasNext();) { File rootFile = (File) i.next(); FileObject root = FileUtil.toFileObject(rootFile); String relative = FileUtil.getRelativePath(root, sourceFile); if (relative != null && ! relative.trim().equals("")) { //NOI18N return new File(relative); } } 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; }
/** * 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); } }
/** Utility method. See {@link #getLibDir()}. */ public synchronized FileObject getLibDirFO() { if (libDirFO == null) { String lib = getLibDir(); if (lib != null) { libDirFO = FileUtil.toFileObject(new File(lib)); } } return libDirFO; }
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); } }
public void openSnapshot(File snapshot) { File sf = FileUtil.normalizeFile(snapshot); FileObject snapshotFo = FileUtil.toFileObject(sf); openSnapshot(snapshotFo); }
/** * @return file object (possibly resolved to the given base folder) or {@code null} if not exists */ public FileObject getFileObject(FileObject baseFolder) { return FileUtil.toFileObject(new File(getAbsoluteFilePath(baseFolder))); }
public void setAsText(final String text) throws IllegalArgumentException { if (text == null) throw new IllegalArgumentException(); File f = new File(text); f = FileUtil.normalizeFile(f); final FileObject fo = FileUtil.toFileObject(f); if (fo == null) throw new IllegalArgumentException(); setValue(fo); }
public FileObject getRootFolder() { FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(art.getFile())); if (fo != null) { return FileUtil.getArchiveRoot(fo); } return null; }
private boolean isUnderneathSourcesOnlyAndVisible(String path) { return isUnderneathSourcesOnlyAndVisible(FileUtil.toFileObject(new File(path))); }
@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; }