@Override public boolean setTime( final FsEntryName name, final BitField<Access> types, final long value, BitField<FsOutputOption> options) throws IOException { final Path file = target.resolve(name.getPath()); final FileTime time = FileTime.fromMillis(value); getBasicFileAttributeView(file).setTimes( types.get(WRITE) ? time : null, types.get(READ) ? time : null, types.get(CREATE) ? time : null); return types.clear(WRITE).clear(READ).clear(CREATE).isEmpty(); }
/** * 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); }
BitField<FsOutputOption> getOutputPreferences() { final BitField<FsOutputOption> prefs = TConfig .get() .getOutputPreferences(); return null != getMountPoint().getParent() ? prefs : prefs.clear(CREATE_PARENTS); }
options = options.set(APPEND).clear(CACHE); return new OptionOutputSocket( controller.getOutputSocket(name, options, template),
.getController( path.getMountPoint(), getDetector(dst)) .getOutputSocket( path.getEntryName(), options.clear(CREATE_PARENTS), template);
@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)); }
@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)); }
switch ((StandardCopyOption) option) { case REPLACE_EXISTING: o = o.clear(EXCLUSIVE); break; case COPY_ATTRIBUTES:
config.getOutputPreferences().clear(GROW));