/** * @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.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)); }
/** * @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)); }
{ ENCODING_MASK, "_-!.~'()*", "_-!.~'()*" }, // mark { ENCODING_MASK, "@", "@" }, { BitField.of(ANY, PATH), ":", "%3A" }, { BitField.of(AUTHORITY, ABSOLUTE_PATH, QUERY, FRAGMENT), ":", ":" }, { BitField.of(ANY, AUTHORITY), "/", "%2F" }, { BitField.of(ABSOLUTE_PATH, PATH, QUERY, FRAGMENT), "/", "/" }, { BitField.of(ANY, AUTHORITY, ABSOLUTE_PATH, PATH), "?", "%3F" }, { BitField.of(QUERY, FRAGMENT), "?", "?" }, { ENCODING_MASK, "#", "%23" }, { ENCODING_MASK, "%", "%25" }, // percent
/** * @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)); }
innerArchive.getController().setTime( getInnerFsEntryName(), BitField.of(Access.WRITE), time, TConfig.get().getOutputPreferences());
@Test public void testClearOne() { BitField<Dummy> bits = BitField.of(ONE).clear(ONE); assertTrue(bits.isEmpty()); assertThat(bits.cardinality(), is(0)); assertFalse(bits.get(ONE)); assertFalse(bits.is(ONE)); assertThat(BitField.copyOf(bits.toEnumSet()), equalTo(bits)); }
assertTrue(c.isLenient()); assertTrue(c.getInputPreferences().isEmpty()); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); c.setInputPreferences(BitField.of(FsInputOption.CACHE)); assertThat(c.getInputPreferences(), is(BitField.of(FsInputOption.CACHE))); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); c.setOutputPreferences(BitField.of(CACHE)); assertThat(c.getOutputPreferences(), is(BitField.of(CACHE))); c.setOutputPreferences(BitField.of(CREATE_PARENTS)); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); c.setOutputPreferences(BitField.of(APPEND)); fail(); } catch (IllegalArgumentException expected) { assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); c.setOutputPreferences(BitField.of(EXCLUSIVE)); fail();
.getController( dstPath.getMountPoint(), driver) .getOutputSocket( dstPath.getEntryName(), BitField.of(FsOutputOption.CREATE_PARENTS, FsOutputOption.EXCLUSIVE), srcSocket.getLocalTarget());
@Test public void testSetTwo() { BitField<Dummy> bits = BitField.of(ONE, TWO); assertFalse(bits.isEmpty()); assertThat(bits.cardinality(), is(2)); assertTrue(bits.get(ONE)); assertTrue(bits.is(ONE)); assertTrue(bits.get(TWO)); assertTrue(bits.is(TWO)); assertThat(BitField.copyOf(bits.toEnumSet()), equalTo(bits)); }
@Test public void defaults() { final TConfig c = TConfig.get(); assertThat(TConfig.get(), sameInstance(c)); final TArchiveDetector detector = c.getArchiveDetector(); assertThat(detector, sameInstance(TArchiveDetector.ALL)); assertThat(c.getArchiveDetector(), sameInstance(detector)); final boolean lenient = c.isLenient(); assertThat(lenient, is(true)); assertThat(c.isLenient(), is(lenient)); assertTrue(c.getInputPreferences().isEmpty()); assertThat(c.getOutputPreferences(), is(BitField.of(CREATE_PARENTS))); }
@Test public void testClearTwo() { BitField<Dummy> bits = BitField.of(ONE, TWO).clear(ONE).clear(TWO); assertTrue(bits.isEmpty()); assertThat(bits.cardinality(), is(0)); assertFalse(bits.get(ONE)); assertFalse(bits.is(ONE)); assertFalse(bits.get(TWO)); assertFalse(bits.is(TWO)); assertThat(BitField.copyOf(bits.toEnumSet()), equalTo(bits)); }