/** * @deprecated As of TrueZIP 7.5, replaced by {@link TVFS#sync(BitField)}. * @see <a href="http://java.net/jira/browse/TRUEZIP-236">#TRUEZIP-236</a> */ @Deprecated public static void umount( boolean waitCloseInput, boolean forceCloseInput, boolean waitCloseOutput, boolean forceCloseOutput) throws FsSyncException { TVFS.sync(BitField .of(CLEAR_CACHE) .set(WAIT_CLOSE_INPUT, waitCloseInput) .set(FORCE_CLOSE_INPUT, forceCloseInput) .set(WAIT_CLOSE_OUTPUT, waitCloseOutput) .set(FORCE_CLOSE_OUTPUT, forceCloseOutput)); }
.set(CREATE_PARENTS, lenient);
/** * @deprecated As of TrueZIP 7.5, replaced by {@link TVFS#sync(BitField)}. * @see <a href="http://java.net/jira/browse/TRUEZIP-236">#TRUEZIP-236</a> */ @Deprecated public static void umount(boolean forceCloseInputAndOutput) throws FsSyncException { TVFS.sync(BitField .of(CLEAR_CACHE) .set(FORCE_CLOSE_INPUT, forceCloseInputAndOutput) .set(FORCE_CLOSE_OUTPUT, forceCloseInputAndOutput)); }
/** * @deprecated Calling this method is equivalent to * {@link TVFS#sync(TFile, BitField) * TVFS.sync(archive, * BitField.of(FsSyncOption.CLEAR_CACHE) * .set(FsSyncOption.WAIT_CLOSE_INPUT, waitCloseInput) * .set(FsSyncOption.FORCE_CLOSE_INPUT, forceCloseInput) * .set(FsSyncOption.WAIT_CLOSE_OUTPUT, waitCloseOutput) * .set(FsSyncOption.FORCE_CLOSE_OUTPUT, forceCloseOutput)) * }. * @see <a href="http://java.net/jira/browse/TRUEZIP-236">#TRUEZIP-236</a> */ @Deprecated public static void umount(TFile archive, boolean waitCloseInput, boolean forceCloseInput, boolean waitCloseOutput, boolean forceCloseOutput) throws FsSyncException { sync( archive, BitField.of(CLEAR_CACHE) .set(WAIT_CLOSE_INPUT, waitCloseInput) .set(FORCE_CLOSE_INPUT, forceCloseInput) .set(WAIT_CLOSE_OUTPUT, waitCloseOutput) .set(FORCE_CLOSE_OUTPUT, forceCloseOutput)); }
/** * @deprecated Calling this method is equivalent to * {@link TVFS#sync(TFile, BitField) * TVFS.sync(archive, * BitField.of(FsSyncOption.CLEAR_CACHE) * .set(FsSyncOption.FORCE_CLOSE_INPUT, forceCloseInputAndOutput) * .set(FsSyncOption.FORCE_CLOSE_OUTPUT, forceCloseInputAndOutput)) * }. * @see <a href="http://java.net/jira/browse/TRUEZIP-236">#TRUEZIP-236</a> */ @Deprecated public static void umount(TFile archive, boolean forceCloseInputAndOutput) throws FsSyncException { sync( archive, BitField.of(CLEAR_CACHE) .set(FORCE_CLOSE_INPUT, forceCloseInputAndOutput) .set(FORCE_CLOSE_OUTPUT, forceCloseInputAndOutput)); }
throws CharConversionException { final ZipDriverEntry entry = super.newEntry(path, type, template, mknod.set(COMPRESS));
/** * Sets {@link FsOutputOption#STORE} in {@code options} before * forwarding the call to {@code controller}. */ @Override public final OptionOutputSocket getOutputSocket( final FsController<?> controller, final FsEntryName name, BitField<FsOutputOption> options, final @CheckForNull Entry template) { // Leave FsOutputOption.COMPRESS untouched - the driver shall be given // opportunity to apply its own preferences to sort out such a conflict. options = options.set(STORE); // The RAES file format cannot support GROWing. options = options.clear(GROW); return new OptionOutputSocket( controller.getOutputSocket(name, options, template), options); }
@CreatesObligation private static OutputStream newOutputStream(final File dst, final boolean append) throws FileNotFoundException { final OutputSocket<?> output = TBIO.getOutputSocket(dst, TConfig.get().getOutputPreferences().set(APPEND, append), null); try { return output.newOutputStream(); } catch (FileNotFoundException ex) { throw ex; } catch (IOException ex) { throw (FileNotFoundException) new FileNotFoundException( dst.toString()).initCause(ex); } } }
/** * Creates a new, empty file similar to its superclass implementation. * Note that this method doesn't create archive files because archive * files are virtual directories, not files! * * @see #mkdir */ @Override public boolean createNewFile() throws IOException { if (null != innerArchive) { final FsController<?> controller = innerArchive.getController(); final FsEntryName entryName = getInnerFsEntryName(); // FIXME: This is not properly isolated. if (null != controller.getEntry(entryName)) return false; controller.mknod( entryName, FILE, TConfig.get().getOutputPreferences().set(EXCLUSIVE), null); return true; } return file.createNewFile(); }
SeekableByteChannel newByteChannel( final TPath path, final Set<? extends OpenOption> options, final FileAttribute<?>... attrs) throws IOException { final FsEntryName name = path.getEntryName(); final FsController<?> controller = getController(); if (options.isEmpty() || options.contains(StandardOpenOption.READ)) { final BitField<FsInputOption> o = path.mapInput(options).set(FsInputOption.CACHE); return controller .getInputSocket(name, o) .newSeekableByteChannel(); } else { final BitField<FsOutputOption> o = path.mapOutput(options).set(FsOutputOption.CACHE); try { return controller .getOutputSocket(name, o, null) .newSeekableByteChannel(); } catch (final IOException ex) { if (o.get(EXCLUSIVE) && null != controller.getEntry(name)) throw (IOException) new FileAlreadyExistsException(path.toString()) .initCause(ex); throw ex; } } }
@Override public void setUp() throws IOException { super.setUp(); final TConfig config = TConfig.get(); config.setOutputPreferences(config.getOutputPreferences().set(ENCRYPT)); }
@Override public void setUp() throws IOException { super.setUp(); final TConfig config = TConfig.get(); config.setOutputPreferences(config.getOutputPreferences().set(ENCRYPT)); }
@Test public void testSetOne() { BitField<Dummy> bits = BitField.noneOf(Dummy.class).set(ONE); assertFalse(bits.isEmpty()); assertThat(bits.cardinality(), is(1)); assertTrue(bits.get(ONE)); assertTrue(bits.is(ONE)); assertThat(BitField.copyOf(bits.toEnumSet()), equalTo(bits)); }
throw new FileSystemException(src.toString(), dst.toString(), "Source and destination are the same file!"); boolean preserve = false; BitField<FsOutputOption> o = dst.getOutputPreferences().set(EXCLUSIVE); for (final CopyOption option : options) { if (!(option instanceof StandardCopyOption))