/** Should check for external modifications. For folders it should reread * the content of disk, for data file it should check for the last * time the file has been modified. * <P> * The file events are marked as unexpected. */ public void refresh() { refresh(false); }
@Override public void refresh(boolean expected) { delegate.refresh(expected); }
@Override public void refresh() { fileObj.refresh(); }
@Override public void refresh() { delegate.refresh(); }
@Override public void refresh(boolean expected) { fileObj.refresh(expected); }
/** * Actually implements contract of FileSystem.refresh(). */ public @Override void refresh(boolean expected) { Enumeration<AbstractFolder> en = getMultiRoot().existingSubFiles(true); while (en.hasMoreElements()) { FileObject fo = en.nextElement(); fo.refresh(expected); } }
public final void refresh(boolean expected) { if (!isInitialized() && isFolder()) { return; } Enumeration<FileObject> en = delegates(); while (en.hasMoreElements()) { FileObject fo = en.nextElement(); fo.refresh(expected); } super.refresh(expected); }
/** * Actually implements contract of FileSystem.refresh(). */ public void refresh(boolean expected) { for (FileObject fo : NbCollections.iterable(getAbstractRoot().existingSubFiles(true))) { fo.refresh(expected); } }
protected void delete(String name) throws IOException { File file = getFile(name); if (deleteFile(file) != SUCCESS) { if (file.exists()) { throw new FSException(NbBundle.getMessage(LocalFileSystem.class, "EXC_CannotDelete", name, getDisplayName(), file.getAbsolutePath())); } else { /** When file externaly deleted and fo.delete () is called before periodical refresh */ FileObject thisFo = findResource(name); if (thisFo != null) { if (thisFo.getParent() != null) { thisFo.getParent().refresh(); } thisFo.refresh(); if (thisFo.isValid()) { throw new FSException(NbBundle.getMessage(LocalFileSystem.class, "EXC_CannotDelete", name, getDisplayName(), file.getAbsolutePath())); } } } } }
/** Should check for external modifications. For folders it should reread * the content of disk, for data file it should check for the last * time the file has been modified. * <P> * The file events are marked as unexpected. */ public void refresh () { refresh (false); }
private static void addToSet(List<DataObject> set, FileObject projectFile, ProjectGenerator.ProjectParameters prjParams, String projectName) throws IOException { try { postProcessProject(projectFile, projectName, prjParams); projectFile.refresh(false); set.add(DataObject.find(projectFile)); } catch (Exception e) { IOException ex = new IOException(e); throw ex; } }
/** * Actually implements contract of FileSystem.refresh(). */ public void refresh (boolean expected) { Enumeration en = getMultiRoot ().existingSubFiles (true); while (en.hasMoreElements()) { FileObject fo = (FileObject)en.nextElement(); fo.refresh(expected); } }
/** * Actually implements contract of FileSystem.refresh(). */ public void refresh (boolean expected) { Enumeration en = getAbstractRoot ().existingSubFiles (true); while (en.hasMoreElements()) { FileObject fo = (FileObject)en.nextElement(); fo.refresh(expected); } }
public J2eeModule.RootedEntry next () { FileObject f = ch.get(0); ch.remove(0); if (f.isFolder()) { f.refresh(); FileObject chArr[] = f.getChildren (); for (int i = 0; i < chArr.length; i++) { ch.add(chArr [i]); } } return new FSRootRE (root, f); }
private void doFireReload() { //TODO is root folder refresh enough? // replace with FileUtil.refresh(File) once it gets into the netbeans.org codebase. project.getProjectDirectory().refresh(); FileObject fo = FileUtil.toFileObject(MavenSettingsSingleton.getInstance().getM2UserDir()); if (fo != null) { fo.refresh(); } support.firePropertyChange(NbMavenProject.PROP_PROJECT, null, null); }
public Iterator<J2eeModule.RootedEntry> getArchiveContents() throws java.io.IOException { FileObject content = getContentDirectory(); content.refresh(); return new IT(content); }
public void run() { FileObject fo = project.getProjectDirectory(); File file = FileUtil.toFile(fo); if (file != null) { FileUtil.refreshFor(file); } else { // just defensive fallback fo.refresh(); } }
/** Find (maybe cached) CRC for a file, using a preexisting input stream (not closed by this method). */ private static String getCrc32(InputStream is, FileObject fo) throws IOException { URL u = fo.getURL(); fo.refresh(); // in case was written on disk and we did not notice yet... long footprint = fo.lastModified().getTime() ^ fo.getSize(); String crc = findCachedCrc32(u, footprint); if (crc == null) { crc = computeCrc32(is); cacheCrc32(crc, u, footprint); } return crc; }