/** * Equivalent to * {@link TConfig#getArchiveDetector TConfig.get().getArchiveDetector()}. */ public static TArchiveDetector getDefaultArchiveDetector() { return TConfig.get().getArchiveDetector(); }
@SuppressWarnings("deprecation") private FsController<?> getController(FsMountPoint mountPoint) { return TConfig.get().getFsManager().getController(mountPoint, detector); }
/** * @deprecated Calling this method is equivalent to * {@link TConfig#setLenient TConfig.get().setLenient(lenient)}. * @see <a href="http://java.net/jira/browse/TRUEZIP-238">#TRUEZIP-238</a> */ @Deprecated public static void setLenient(boolean lenient) { TConfig.get().setLenient(lenient); }
/** Unchecked parameters version. */ private static void cp0(final boolean preserve, final File src, final File dst) throws IOException { final TConfig config = TConfig.get(); final InputSocket<?> input = getInputSocket(src, config.getInputPreferences()); final OutputSocket<?> output = getOutputSocket(dst, config.getOutputPreferences(), preserve ? input.getLocalTarget() : null); IOSocket.copy(input, output); }
@Override public void setUp() throws IOException { super.setUp(); final TConfig config = TConfig.get(); config.setOutputPreferences(config.getOutputPreferences().set(ENCRYPT)); }
/** * @deprecated Calling this method is equivalent to * {@link TConfig#getArchiveDetector TConfig.get().getArchiveDetector()}. * @see <a href="http://java.net/jira/browse/TRUEZIP-238">#TRUEZIP-238</a> */ @Deprecated public static TArchiveDetector getDefaultArchiveDetector() { return TConfig.get().getArchiveDetector(); }
/** * Equivalent to * {@link TConfig#setArchiveDetector TConfig.get().setArchiveDetector(detector)}. */ public static void setDefaultArchiveDetector(TArchiveDetector detector) { TConfig.get().setArchiveDetector(detector); }
@Override public void setUp() throws IOException { super.setUp(); final TConfig config = TConfig.get(); config.setOutputPreferences(config.getOutputPreferences().set(ENCRYPT)); }
@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(); }
private static TArchiveDetector getDetector(File file) { return file instanceof TFile ? ((TFile) file).getArchiveDetector() : TConfig.get().getArchiveDetector(); } }
/** * Equivalent to * {@link TConfig#isLenient TConfig.get().isLenient()}. */ public static boolean isLenient() { return TConfig.get().isLenient(); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { parse( FsPath.create((URI) in.readObject(), CANONICALIZE), TConfig.get().getArchiveDetector()); }
/** * @deprecated Calling this method is equivalent to * {@link TConfig#setArchiveDetector TConfig.get().setArchiveDetector(detector)}. * @see <a href="http://java.net/jira/browse/TRUEZIP-238">#TRUEZIP-238</a> */ @Deprecated public static void setDefaultArchiveDetector(TArchiveDetector detector) { TConfig.get().setArchiveDetector(detector); }
@Override protected TArchiveDetector newArchiveDetector1(String suffix, String password) { return KeyManagement.newArchiveDetector1( TConfig.get().getArchiveDetector(), suffix, password.getBytes(US_ASCII)); }
/** * Pops the {@link #get() current configuration} off the inheritable thread * local configuration stack. * * @throws IllegalStateException If the {@link #get() current configuration} * is the global configuration. */ @DischargesObligation public static void pop() { configs.popIf(get()); }
@Override protected TArchiveDetector newArchiveDetector2(String suffix, String password) { return KeyManagement.newArchiveDetector2( TConfig.get().getArchiveDetector(), suffix, password.toCharArray()); } }
/** * Creates a new current configuration by copying the current configuration * and pushing the copy onto the inheritable thread local configuration * stack. * * @return The new current configuration. * @see #get() */ @CreatesObligation public static TConfig push() { return configs.push(new TConfig(get())); }
static void install(TArchiveDetector detector) { // START SNIPPET: install TConfig.get().setArchiveDetector(detector); // END SNIPPET: install }
private void assertRenameTo(TPath src, TPath dst) throws IOException { assertTrue(exists(src)); assertFalse(exists(dst)); assertFalse(exists(dst.toNonArchivePath())); assert TConfig.get().isLenient(); src.toFile().mv(dst.toFile()); assertFalse(exists(src)); assertFalse(exists(src.toNonArchivePath())); assertTrue(exists(dst)); }
private void assertRenameTo(TFile src, TFile dst) throws IOException { assertTrue(src.exists()); assertFalse(dst.exists()); assertFalse(dst.toNonArchiveFile().exists()); assert TConfig.get().isLenient(); src.mv(dst); assertFalse(src.exists()); assertFalse(src.toNonArchiveFile().exists()); assertTrue(dst.exists()); }