/** * Equivalent to {@link #cp_rp(File, File, TArchiveDetector, TArchiveDetector) cp_rp(this, dst, detector, detector)}. * * @param src the source file or directory tree. * Note that although this just needs to be a plain {@code File}, * archive files and entries are only supported for instances of * this class. * @param dst the destination file or directory tree. * Note that although this just needs to be a plain {@code File}, * archive files and entries are only supported for instances of * this class. * @param detector the archive detector to use for detecting any * archive files <em>within</em> the source and destination * directory tree. * @throws IOException if any I/O error occurs. * @since TrueZIP 7.2 * @see <a href="#bulkIOMethods">Bulk I/O Methods</a> * @see <a href="#traversal">Traversing Directory Trees</a> */ @ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public static void cp_rp(File src, File dst, TArchiveDetector detector) throws IOException { TBIO.cp_r(true, src, dst, detector, detector); }
/** * Returns {@code TFile} objects for the members in this directory * in a newly created array. * The returned array is <em>not</em> sorted. * <p> * Note that archive entries with absolute paths are ignored by this * method and are never returned. * * @param detector The archive detector to detect any archives files in * the member file names. * @return A possibly empty array with the members of this (virtual) * directory or {@code null} if this instance does not refer to a * (virtual) directory or if the virtual directory is inaccessible * due to an I/O failure. */ @ExpertFeature(value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public @Nullable TFile[] listFiles(TArchiveDetector detector) { return listFiles((FilenameFilter) null, detector); }
/** * Equivalent to {@link #cp_r(File, File, TArchiveDetector, TArchiveDetector) cp_r(this, dst, detector, detector)}. * * @param src the source file or directory tree. * Note that although this just needs to be a plain {@code File}, * archive files and entries are only supported for instances of * this class. * @param dst the destination file or directory tree. * Note that although this just needs to be a plain {@code File}, * archive files and entries are only supported for instances of * this class. * @param detector the archive detector to use for detecting any * archive files <em>within</em> the source and destination * directory tree. * @throws IOException if any I/O error occurs. * @since TrueZIP 7.2 * @see <a href="#bulkIOMethods">Bulk I/O Methods</a> * @see <a href="#traversal">Traversing Directory Trees</a> */ @ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public static void cp_r(File src, File dst, TArchiveDetector detector) throws IOException { TBIO.cp_r(false, src, dst, detector, detector); }
@ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public static void cp_rp(File src, File dst,
/** * Commits all pending changes for all (nested) archive files within the * given (virtual) directory {@code tree} to their respective parent file * system with respect to the given options. * * @param tree a file or directory in the (virtual) file system space. * @param options an array 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. */ @ExpertFeature(THE_PRESENCE_OR_ABSENCE_OF_SOME_OPTIONS_MAY_YIELD_UNWANTED_SIDE_EFFECTS) public static void sync(TFile tree, FsSyncOption... options) throws FsSyncException { sync(tree, FsSyncOptions.of(options)); }
/** * Commits all pending changes for all (nested) archive files to their * respective parent file system with respect to the given options. * * @param options an array 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. */ @ExpertFeature(THE_PRESENCE_OR_ABSENCE_OF_SOME_OPTIONS_MAY_YIELD_UNWANTED_SIDE_EFFECTS) public static void sync(FsSyncOption... options) throws FsSyncException { sync(FsSyncOptions.of(options)); }
@ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public static void cp_r(File src, File dst,
/** * Commits all pending changes for all (nested) archive files within the * given (virtual) directory {@code tree} to their respective parent file * system with respect to the given options. * * @param tree a file or directory in the (virtual) file system space. * @param options an array 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. */ @ExpertFeature(THE_PRESENCE_OR_ABSENCE_OF_SOME_OPTIONS_MAY_YIELD_UNWANTED_SIDE_EFFECTS) public static void sync(FsMountPoint tree, FsSyncOption... options) throws FsSyncException { sync(tree, FsSyncOptions.of(options)); }
/** * Constructs a new {@code TFile} instance which may use the given archive * detector to scan the <em>entire path name</em> for prospective archive * files. * * @param parent the parent directory. * @param member the member path name. * @param detector the archive detector to use for scanning the path name * for prospective archive files. * If this parameter is {@code null}, then the * {@linkplain TConfig#getArchiveDetector default archive detector} * is used instead. */ @ExpertFeature(INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile( final @CheckForNull String parent, final String member, final @CheckForNull TArchiveDetector detector) { super(parent, member); this.file = new File(parent, member); this.detector = null != detector ? detector : TConfig.get().getArchiveDetector(); scan(null); assert invariants(); }
/** * Commits all pending changes for all (nested) archive files within the * given (virtual) directory {@code tree} to their respective parent file * system with respect to the given options. * * @param tree a file or directory in the (virtual) file system space. * @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. */ @ExpertFeature(THE_PRESENCE_OR_ABSENCE_OF_SOME_OPTIONS_MAY_YIELD_UNWANTED_SIDE_EFFECTS) public static void sync(TFile tree, BitField<FsSyncOption> options) throws FsSyncException { sync(mountPoint(tree), options); }
/** * Constructs a new {@code TFile} instance which may use the given * {@link TArchiveDetector} to scan its path name for prospective archive * files. * * @param path the path name. * @param detector the archive detector to use for scanning the path name * for prospective archive files. * If this parameter is {@code null}, then the * {@linkplain TConfig#getArchiveDetector default archive detector} * is used instead. */ @ExpertFeature(INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile( final String path, final @CheckForNull TArchiveDetector detector) { super(path); this.file = new File(path); this.detector = null != detector ? detector : TConfig.get().getArchiveDetector(); scan(null); assert invariants(); }
@ExpertFeature(INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile( final @CheckForNull File parent, final String member,
/** * Returns a file object for the same path name, but does not detect any * archive file name patterns in the last path name segment. * The parent file object is unaffected by this transformation, so the * path name of this file object may address an entry in an archive file. * * @return A file object for the same path name, but does not detect any * archive file name patterns in the last path name segment. * @see TVFS#umount(TFile) * @since TrueZIP 7.5 */ @ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile toNonArchiveFile() { return isArchive() ? new TFile(getParentFile(), getName(), TArchiveDetector.NULL) : this; }
/** * 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); }
@ExpertFeature(value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public @Nullable TFile[] listFiles( final @CheckForNull FileFilter filter,
@ExpertFeature(value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public @Nullable TFile[] listFiles( final @CheckForNull FilenameFilter filter,
@ExpertFeature(INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile( final File file, final @CheckForNull TArchiveDetector detector) {
@ExpertFeature(INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public TFile( final FsPath path, final @CheckForNull TArchiveDetector detector) {
/** * Commits all pending changes for all (nested) archive files within the * given (virtual) directory {@code tree} to their respective parent file * system with respect to the given options. * * @param tree a file or directory in the (virtual) file system space. * @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(FsMountPoint tree, BitField<FsSyncOption> options) throws FsSyncException { new FsFilteringManager(TConfig.get().getFsManager(), tree) .sync(options); } }
@ExpertFeature( level=INTERMEDIATE, value=INJECTING_A_DIFFERENT_DETECTOR_FOR_THE_SAME_PATH_MAY_CORRUPT_DATA) public static void mv(