public @Override SystemAction[] getActions(final Set<FileObject> foSet) { List<SystemAction> al = new ArrayList<SystemAction>(101); // randomly choosen constant Set<SystemAction> uniq = new HashSet<SystemAction>(101); // not that randommly choosen final FileSystem[] del = this.getDelegates(); for (int i = 0; i < del.length; i++) { if (del[i] == null) { continue; } final SystemAction[] acts = del[i].getActions(foSet); for (int j = 0; j < acts.length; j++) { if (uniq.add(acts[j])) { al.add(acts[j]); } } } return al.toArray(new SystemAction[al.size()]); }
/** Merge actions from all delegates. */ public @Override SystemAction[] getActions() { List<SystemAction> al = new ArrayList<SystemAction>(101); // randomly choosen constant Set<SystemAction> uniq = new HashSet<SystemAction>(101); // not that randommly choosen FileSystem[] del = this.getDelegates(); for (int i = 0; i < del.length; i++) { if (del[i] == null) { continue; } SystemAction[] acts = del[i].getActions(); for (int j = 0; j < acts.length; j++) { if (uniq.add(acts[j])) { al.add(acts[j]); } } } return al.toArray(new SystemAction[al.size()]); }
/** Lets any sub filesystems prepare the environment. * If they do not support it, it does not care. * @deprecated Useless. */ @Deprecated public @Override void prepareEnvironment(FileSystem.Environment env) throws EnvironmentNotSupportedException { FileSystem[] layers = getDelegates(); for (int i = 0; i < layers.length; i++) { if (layers[i] != null) { try { layers[i].prepareEnvironment(env); } catch (EnvironmentNotSupportedException ense) { // Fine. } } } }
boolean canHaveRootAttributeOnReadOnlyFS(String name) { Set<String> tmp = rootAttributes; if (tmp == null) { tmp = new HashSet<String>(); for (FileSystem fs : getDelegates()) { if (fs == null) { continue; } if (!fs.isReadOnly()) { continue; } Enumeration<String> en = fs.getRoot().getAttributes(); while (en.hasMoreElements()) { tmp.add(en.nextElement()); } rootAttributes = tmp; } } if (tmp == Collections.<String>emptySet()) { return true; } return tmp.contains(name); } }
/** Deletes a all mask files that mask the given file. All * higher levels then fs are checked and mask is deleted if necessary * @param fs filesystem where res is placed * @param res resource name of the file that should be unmasked * @exception IOException if it fails */ void unmaskFileOnAll(FileSystem fs, String res) throws IOException { FileSystem[] fss = this.getDelegates(); for (int i = 0; i < fss.length; i++) { if ((fss[i] == null) || fss[i].isReadOnly()) { continue; } unmaskFile(fss[i], res); /** unamsk on all higher levels, which mask files on fs-layer */ if (fss[i] == fs) { return; } } }
private final Enumeration<String> getAttributes(String path) { Set<String> s = new HashSet<String>(); FileSystem[] systems = getMultiFileSystem().getDelegates(); final boolean empty = path.length() == 0;
FileSystem[] systems = getMultiFileSystem().getDelegates(); FileSystem writable = getMultiFileSystem().writableLayer(path);
FileSystem[] arr = mfs.getDelegates();
/** This method was added to achieve firing events that attributes * were changed after setDelegates. Events are not fired reliable but this solution was * choosed because of performance reasons. Attributes name is set to null - what means * that one of attributes was probably changed. */ void updateAllAfterSetDelegates(FileSystem[] oldFileSystems) { try { getMultiFileSystem().beginAtomicAction(); FileSystem[] fileSystems = getMultiFileSystem().getDelegates(); Enumeration<AbstractFolder> en = existingSubFiles(true); while (en.hasMoreElements()) { MultiFileObject mfo = (MultiFileObject) en.nextElement(); if (mfo.isFolder() && !mfo.isInitialized()) { continue; } if (mfo.hasListeners()) { String path = mfo.getPath(); FileObject oldLeader = findLeader(oldFileSystems, path); FileObject newLeader = findLeader(fileSystems, path); if ((oldLeader != null) && (newLeader != null) && !oldLeader.equals(newLeader)) { mfo.fileAttributeChanged0(new FileAttributeEvent(mfo, null, null, null)); } } mfo.freeAttribCache(); mfo.refresh(true); } } finally { getMultiFileSystem().finishAtomicAction(); } }
FileSystem[] systems = getMultiFileSystem().getDelegates();
public SystemAction[] getActions (final Set foSet) { final ArrayList al = new ArrayList(101); // randomly choosen constant final HashSet uniq = new HashSet(101); // not that randommly choosen final FileSystem[] del = this.getDelegates(); for (int i=0; i<del.length; i++) { if (del[i] == null) continue; final SystemAction[] acts = del[i].getActions(foSet); for (int j=0; j<acts.length; j++) { if (uniq.add(acts[j])) al.add(acts[j]); } } return (SystemAction[])al.toArray(new SystemAction[al.size ()]); }
public SystemAction[] getActions (final Set foSet) { final ArrayList al = new ArrayList(101); // randomly choosen constant final HashSet uniq = new HashSet(101); // not that randommly choosen final FileSystem[] del = this.getDelegates(); for (int i=0; i<del.length; i++) { if (del[i] == null) continue; final SystemAction[] acts = del[i].getActions(foSet); for (int j=0; j<acts.length; j++) { if (uniq.add(acts[j])) al.add(acts[j]); } } return (SystemAction[])al.toArray(new SystemAction[al.size ()]); }
/** Merge actions from all delegates. */ public SystemAction[] getActions () { ArrayList al = new ArrayList(101); // randomly choosen constant HashSet uniq = new HashSet(101); // not that randommly choosen FileSystem[] del = this.getDelegates(); for (int i=0; i<del.length; i++) { if (del[i] == null) continue; SystemAction[] acts = del[i].getActions(); for (int j=0; j<acts.length; j++) { if (uniq.add(acts[j])) al.add(acts[j]); } } return (SystemAction[])al.toArray(new SystemAction[al.size ()]); }
/** Merge actions from all delegates. */ public SystemAction[] getActions () { ArrayList al = new ArrayList(101); // randomly choosen constant HashSet uniq = new HashSet(101); // not that randommly choosen FileSystem[] del = this.getDelegates(); for (int i=0; i<del.length; i++) { if (del[i] == null) continue; SystemAction[] acts = del[i].getActions(); for (int j=0; j<acts.length; j++) { if (uniq.add(acts[j])) al.add(acts[j]); } } return (SystemAction[])al.toArray(new SystemAction[al.size ()]); }
/** Lets any sub filesystems prepare the environment. * If they do not support it, it does not care. * @deprecated Useless. */ public void prepareEnvironment (FileSystem.Environment env) throws EnvironmentNotSupportedException { FileSystem[] layers = getDelegates (); for (int i = 0; i < layers.length; i++) { if (layers[i] != null) { try { layers[i].prepareEnvironment (env); } catch (EnvironmentNotSupportedException ense) { // Fine. } } } }
/** Lets any sub filesystems prepare the environment. * If they do not support it, it does not care. * @deprecated Useless. */ public void prepareEnvironment (FileSystem.Environment env) throws EnvironmentNotSupportedException { FileSystem[] layers = getDelegates (); for (int i = 0; i < layers.length; i++) { if (layers[i] != null) { try { layers[i].prepareEnvironment (env); } catch (EnvironmentNotSupportedException ense) { // Fine. } } } }
/** Deletes a all mask files that mask the given file. All * higher levels then fs are checked and mask is deleted if necessary * @param fs filesystem where res is placed * @param res resource name of the file that should be unmasked * @exception IOException if it fails */ void unmaskFileOnAll (FileSystem fs,String res) throws IOException { FileSystem[] fss = this.getDelegates(); for (int i = 0; i < fss.length ; i++) { if (fss[i] == null || fss[i].isReadOnly()) continue; unmaskFile (fss[i], res); /** unamsk on all higher levels, which mask files on fs-layer */ if (fss[i] == fs) return; } }
/** Deletes a all mask files that mask the given file. All * higher levels then fs are checked and mask is deleted if necessary * @param fs filesystem where res is placed * @param res resource name of the file that should be unmasked * @exception IOException if it fails */ void unmaskFileOnAll (FileSystem fs,String res) throws IOException { FileSystem[] fss = this.getDelegates(); for (int i = 0; i < fss.length ; i++) { if (fss[i] == null || fss[i].isReadOnly()) continue; unmaskFile (fss[i], res); /** unamsk on all higher levels, which mask files on fs-layer */ if (fss[i] == fs) return; } }
try { getMultiFileSystem().beginAtomicAction(); FileSystem[] fileSystems = getMultiFileSystem().getDelegates(); Enumeration en = existingSubFiles(true); while (en.hasMoreElements()) {
try { getMultiFileSystem().beginAtomicAction(); FileSystem[] fileSystems = getMultiFileSystem().getDelegates(); Enumeration en = existingSubFiles(true); while (en.hasMoreElements()) {