/** For given file object finds the filesystem that the object is placed on. * The object must be created by this filesystem orherwise IllegalArgumentException * is thrown. * * @param fo file object * @return the filesystem (from the list we delegate to) the object has file on * @exception IllegalArgumentException if the file object is not represented in this filesystem */ protected final FileSystem findSystem(FileObject fo) throws IllegalArgumentException { try { if (fo instanceof MultiFileObject) { MultiFileObject mfo = (MultiFileObject) fo; return mfo.getLeaderFileSystem(); } } catch (FileStateInvalidException ex) { // can happen if there is no delegate, I do not know what to return // better, but we should not throw the exception return this; } throw new IllegalArgumentException(fo.getPath()); }
/** For given file object finds the filesystem that the object is placed on. * The object must be created by this filesystem orherwise IllegalArgumentException * is thrown. * * @param fo file object * @return the filesystem (from the list we delegate to) the object has file on * @exception IllegalArgumentException if the file object is not represented in this filesystem */ protected final FileSystem findSystem (FileObject fo) throws IllegalArgumentException { try { if (fo instanceof MultiFileObject) { MultiFileObject mfo = (MultiFileObject)fo; return mfo.getLeaderFileSystem (); } } catch (FileStateInvalidException ex) { // can happen if there is no delegate, I do not know what to return // better, but we should not throw the exception return this; } throw new IllegalArgumentException (fo.getPath()); }
/** For given file object finds the filesystem that the object is placed on. * The object must be created by this filesystem orherwise IllegalArgumentException * is thrown. * * @param fo file object * @return the filesystem (from the list we delegate to) the object has file on * @exception IllegalArgumentException if the file object is not represented in this filesystem */ protected final FileSystem findSystem (FileObject fo) throws IllegalArgumentException { try { if (fo instanceof MultiFileObject) { MultiFileObject mfo = (MultiFileObject)fo; return mfo.getLeaderFileSystem (); } } catch (FileStateInvalidException ex) { // can happen if there is no delegate, I do not know what to return // better, but we should not throw the exception return this; } throw new IllegalArgumentException (fo.getPath()); }
FileSystem leaderfs; try { leaderfs = getLeaderFileSystem (); } catch (FileStateInvalidException fsie) {
FileSystem leaderfs; try { leaderfs = getLeaderFileSystem (); } catch (FileStateInvalidException fsie) {