@SuppressWarnings("deprecation") private FsController<?> getController(FsMountPoint mountPoint) { return TConfig.get().getFsManager().getController(mountPoint, detector); }
/** * Commits all pending changes for all (nested) archive files to their * respective parent file system with respect to the given options. * * @param options a bit field of options for the synchronization operation. * @throws IllegalArgumentException if the combination of synchronization * options is illegal, e.g. if * {@code FsSyncOption.FORCE_CLOSE_INPUT} is cleared and * {@code FsSyncOption.FORCE_CLOSE_OUTPUT} is set or if * {@code FsSyncOption.ABORT_CHANGES} is set. * @throws FsSyncWarningException if <em>only</em> warning conditions * apply. * This implies that the respective parent file system has been * synchronized with constraints, e.g. if * {@code FsSyncOption.FORCE_CLOSE_INPUT} or * {@code FsSyncOption.FORCE_CLOSE_OUTPUT} is set and an unclosed * archive entry stream gets forcibly closed. * @throws FsSyncException if any error conditions apply. */ @SuppressWarnings("deprecation") @ExpertFeature(THE_PRESENCE_OR_ABSENCE_OF_SOME_OPTIONS_MAY_YIELD_UNWANTED_SIDE_EFFECTS) public static void sync(BitField<FsSyncOption> options) throws FsSyncException { TConfig.get().getFsManager().sync(options); }
private void waitAllManagers() { do { System.gc(); // triggering GC in a loop seems to help with concurrency! } while (0 < manager.getSize()); } }
FsPath path = FsPath.create(uri, FsUriModifier.CANONICALIZE); InputSocket<?> socket = manager .getController( path.getMountPoint(), driver) .getInputSocket( path.getEntryName(), BitField.noneOf(FsInputOption.class)); manager.sync(FsSyncOptions.UMOUNT);
manager.getController( FsMountPoint.create(URI.create(param)), driver); assertThat(manager.getSize(), is(params[1].length)); assertThat(filter.getSize(), is(params[2].length)); for (final FsController<?> controller : filter) assertTrue(set.contains(controller.getModel().getMountPoint()));
= FsMountPoint.create(URI.create(param)); final FsController<?> controller = manager.getController(mountPoint, driver); if (null != member && null != controller.getParent()) assertThat(controller, sameInstance((Object) member.getParent())); Iterator<FsController<?>> i = manager.iterator(); for (final String param : params) { final FsMountPoint mountPoint assertThat(manager.getSize(), is(params.length)); member = null; i = null;
FsPath srcPath = FsPath.create(srcUri, FsUriModifier.CANONICALIZE); InputSocket<?> srcSocket = manager .getController( srcPath.getMountPoint(), driver) .getInputSocket( srcPath.getEntryName(), BitField.noneOf(FsInputOption.class)); FsPath dstPath = FsPath.create(dstUri, FsUriModifier.CANONICALIZE); OutputSocket<?> dstSocket = manager .getController( dstPath.getMountPoint(), driver) .getOutputSocket( dstPath.getEntryName(), BitField.of(FsOutputOption.CREATE_PARENTS, manager.sync(FsSyncOptions.UMOUNT);
= FsMountPoint.create(URI.create(param)); final FsController<?> controller = manager.getController(mountPoint, driver); if (null != parent && null != parent.getParent()) assertThat(controller.getParent(), sameInstance((Object) parent)); assertThat(manager.getSize(), is(params.length)); parent = null; waitAllManagers();
@SuppressWarnings("deprecation") TFileSystem(final TPath path) { assert null != path; this.controller = TConfig.get().getFsManager().getController( path.getMountPoint(), path.getArchiveDetector()); this.provider = TFileSystemProvider.get(path.getName()); assert invariants(); }
@Test public void testGetControllerWithNull() { for (final Type type : BitField.allOf(Type.class)) { try { newManager(type).getController(null, null); fail(); } catch (NullPointerException expected) { } } }
.get() .getFsManager() .getController( path.getMountPoint(), getDetector(dst)) .getOutputSocket( path.getEntryName(), options.clear(CREATE_PARENTS),
/** * Returns an input socket for the given file. * * @param src the file to read. * @param options the options for accessing the file. * @return An input socket for the given file. */ @SuppressWarnings("deprecation") static InputSocket<?> getInputSocket(final File src, final BitField<FsInputOption> options) { if (src instanceof TFile) { final TFile tsrc = (TFile) src; final TFile archive = tsrc.getInnerArchive(); if (null != archive) return archive .getController() .getInputSocket(tsrc.getInnerFsEntryName(), options); } final FsPath path = new FsPath(src); return TConfig .get() .getFsManager() .getController( path.getMountPoint(), getDetector(src)) .getInputSocket(path.getEntryName(), options); }