/** Refresh the content of file. Ignores changes to the files provided, * instead returns its file object. * @param added do not notify addition of this file * @param removed do not notify removing of this file */ protected final void refresh(String added, String removed) { this.refresh(added, removed, false); }
super.refresh(added, removed, fire, expected, list); } else { StreamPool strPool = StreamPool.find(this);
/** Refresh the content of file. Ignores changes to the files provided, * instead returns its file object. * @param added do not notify addition of this file * @param removed do not notify removing of this file * @param fire true if we should fire changes * @param expected true if the change has been expected by the user */ protected void refresh(String added, String removed, boolean fire, boolean expected) { this.refresh(added, removed, fire, expected, null); }
private void superRefresh(boolean expected) { super.refresh(expected); }
/** Test if the file has been checked and if not, refreshes its * content. */ private final void check() { if (map == null) { refresh(null, null, false, false); if (map == null) { // create empty map to mark that we are initialized map = Collections.emptyMap(); if (children == null) { children = new String[] { }; } } } }
/** Refresh the content of file. Ignores changes to the files provided, * instead returns its file object. * @param added do not notify addition of this file * @param removed do not notify removing of this file * @param reuseChildren a flag reuse children? */ protected final void refresh(String added, String removed, boolean reuseChildren) { String[] prev = children; if (reuseChildren && removed != null && prev != null) { String[] nc = prev.clone(); for (int i = nc.length; --i >= 0;) { if (removed.equals(nc[i])) { nc[i] = null; break; } } refresh(added, removed, true, false, nc); } else { refresh(added, removed, true, false, null); } }
private void refreshChildren(final Enumeration<? extends AbstractFolder> subfiles, final Collection nameFilter, boolean expected) { while (subfiles.hasMoreElements()) { AbstractFolder child = subfiles.nextElement(); if (child.isData()) { if (!nameFilter.contains(child.getNameExt())) { child.refresh(expected); } } } }
public void refresh(boolean expected) { if (!isInitialized() && isFolder()) { return; } refresh(null, null, true, 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); }
private void doLoop(int ms) { AbstractFileSystem system = this.system.get(); if (system == null) { // end for ever the fs does not exist no more return; } if ((en == null) || !en.hasMoreElements()) { // start again from root en = NbCollections.checkedEnumerationByFilter(existingFolders(system), AbstractFolder.class, true); } for (int i = 0; (i < REFRESH_COUNT) && en.hasMoreElements(); i++) { AbstractFolder fo = en.nextElement(); if ((fo != null) && (!fo.isFolder() || fo.isInitialized())) { fo.refresh(); } if (refreshTime <= 0) { // after each refresh check the current value of refreshTime // again and if it goes to zero exit as fast a you can return; } } // clear the queue if (!en.hasMoreElements()) { en = null; } }
/** refreshes children recursively.*/ private void refreshExistingFileObjects() { Cache cache = getCache(); String[] empty = new String[0]; Enumeration<? extends FileObject> en = existingFileObjects(getRoot()); while (en.hasMoreElements()) { AbstractFolder fo = (AbstractFolder) en.nextElement(); assert fo != null; if (fo.isFolder() && !fo.isInitialized()) { continue; } String[] children = cache.getChildrenOf(fo.getPath()); if (children == null) { children = empty; } fo.refresh(null, null, true, true, children); } }
/** [PENDING] expected rename of some refresh method */ /*protected void internalRefresh ( String add, String remove, boolean fire, boolean expected, String[] list **/ protected void refresh(String add, String remove, boolean fire, boolean expected) { try { getFileSystem().beginAtomicAction(); synchronized (this) { update(); /** [PENDING] expected rename of some refresh method */ //super.internalRefresh (add, remove, fire, expected, list); super.refresh(add, remove, fire, expected); } validFlag &= leader.isValid(); } finally { getFileSystem().finishAtomicAction(); } }
parent.refresh(name, oldName);
/** refreshes children recursively.*/ private void refreshChildren(AbstractFolder fo, ResourceElem resElem) { if (fo.isRoot()) { initializeReference(rootRef = new FileObjRef<AbstractFolder>(fo), resElem); } java.util.List<String> nameList = resElem.getChildren(); String[] names = new String[nameList.size()]; ResourceElem[] children = new ResourceElem[names.length]; nameList.toArray(names); for (int i = 0; i < names.length; i++) children[i] = resElem.getChild(names[i]); fo.refresh(null, null, true, true, names); for (int i = 0; i < children.length; i++) { AbstractFolder fo2 = (AbstractFolder) fo.getFileObject(names[i]); FileObjRef currentRef = (FileObjRef) findReference(fo2.getPath()); int diff = initializeReference(currentRef, children[i]); fo2.lastModified(); if (fo2.isFolder()) { refreshChildren(fo2, children[i]); } else { if ((diff & 0x01) != 0) { fo2.fileChanged0(new FileEvent(fo2)); } else { if ((diff & 0x02) != 0) { fo2.fileAttributeChanged0(new FileAttributeEvent(fo2, null, null, null)); } } } } }
void handleDelete(FileLock lock) throws IOException { if (parent == null) { throw new FSException(NbBundle.getMessage(MultiFileObject.class, "EXC_CannotDeleteRoot", getMultiFileSystem().getDisplayName())); } MultiFileSystem fs = getMultiFileSystem(); try { getFileSystem().beginAtomicAction(); synchronized (parent) { String fullName = getPath(); FileSystem single = fs.createWritableOn(fullName); if (needsMask(lock, true)) { getMultiFileSystem().maskFile(single, fullName); updateFoldersLock(getParent()); } String n = name; validFlag = false; /** [PENDING] expected rename of some refresh method */ //parent.internalRefresh (null, n, true, false, null); parent.refresh(null, n, true, false); if (hasAtLeastOneListeners()) { fileDeleted0(new FileEvent(this)); } } } finally { getFileSystem().finishAtomicAction(); } }
validFlag = false; parent.refresh(null, n, true);
parent.refresh(null, oldN);
parent.refresh(name, oldName);
private void refreshChildren(final Enumeration subfiles, final Collection nameFilter, boolean expected) { while (subfiles.hasMoreElements()) { AbstractFolder child = (AbstractFolder) subfiles.nextElement(); if (child.isData()) { if (!nameFilter.contains(child.getNameExt())) { child.refresh(expected); } } } }
private void refreshChildren(final Enumeration subfiles, final Collection nameFilter, boolean expected) { while (subfiles.hasMoreElements()) { AbstractFolder child = (AbstractFolder) subfiles.nextElement(); if (child.isData()) { if (!nameFilter.contains(child.getNameExt())) { child.refresh(expected); } } } }