TrueZIP File* 7.0

de.schlichtherle.truezip.file
Class TBIO

java.lang.Object
  extended by de.schlichtherle.truezip.file.TBIO

@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
@Immutable
final class TBIO
extends Object

Provides fast bulk I/O operations for Files and TFiles.

Note that in contrast to the TFile class, the methods in this class accept plain old File objects. However, full advantage is taken if a parameter is a TFile object.

Author:
Christian Schlichtherle

Field Summary
private static BitField<FsInputOption> NONEOF_INPUT_OPTIONS
           
private static BitField<FsOutputOption> NONEOF_OUTPUT_OPTIONS
           
 
Constructor Summary
private TBIO()
          You cannot instantiate this class.
 
Method Summary
private static void checkContains(File a, File b)
          Throws an IOException if and only if the path represented by a contains the path represented by b, where a path is said to contain another path if and only if it is equal or an ancestor of the other path.
static void cp_r(boolean preserve, File src, File dst, TArchiveDetector srcDetector, TArchiveDetector dstDetector)
          Recursively copies the source directory tree or file to the destination directory tree or file.
private static void cp_r0(boolean preserve, File src, File dst, TArchiveDetector srcDetector, TArchiveDetector dstDetector)
           
static void cp(boolean preserve, File src, File dst)
          Copies a single source file to a destination file.
private static void cp0(boolean preserve, File src, File dst)
           
(package private) static InputSocket<?> getInputSocket(File src, BitField<FsInputOption> options)
           
(package private) static OutputSocket<?> getOutputSocket(File dst, BitField<FsOutputOption> options, Entry template)
           
static void mv(File src, File dst, TArchiveDetector detector)
          Moves the source file or directory tree to the destination file or directory tree by performing a recursive cp-then-delete operation.
private static void mv0(File src, File dst, TArchiveDetector detector)
          Unchecked parameters version.
static void rm_r(File node, TArchiveDetector detector)
          Recursively deletes the given file or directory tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONEOF_INPUT_OPTIONS

private static final BitField<FsInputOption> NONEOF_INPUT_OPTIONS

NONEOF_OUTPUT_OPTIONS

private static final BitField<FsOutputOption> NONEOF_OUTPUT_OPTIONS
Constructor Detail

TBIO

private TBIO()
You cannot instantiate this class.

Method Detail

mv

public static void mv(File src,
                      File dst,
                      TArchiveDetector detector)
               throws IOException
Moves the source file or directory tree to the destination file or directory tree by performing a recursive cp-then-delete operation. Hence, this file system operation works even with archive files or entries within archive files, but is not atomic.

Parameters:
src - the source directory tree or file. This file system entity needs to exist.
dst - the destination directory tree or file. This file systeme entity may or may not exist. If it does, its contents are overwritten.
detector - the object used to detect any archive files in the source and destination paths.
Throws:
IOException - if the source path contains the destination path or an elementary operation fails for any reason.

mv0

private static void mv0(File src,
                        File dst,
                        TArchiveDetector detector)
                 throws IOException
Unchecked parameters version.

Throws:
IOException

cp_r

public static void cp_r(boolean preserve,
                        File src,
                        File dst,
                        TArchiveDetector srcDetector,
                        TArchiveDetector dstDetector)
                 throws IOException
Recursively copies the source directory tree or file to the destination directory tree or file.

Parameters:
preserve - if an elementary cp operation shall cp as much properties of the source file to the destination file, too. Currently, only the last modification time is preserved. Note that this property set may get extended over time.
src - the source directory tree or file. This file system entity needs to exist.
dst - the destination directory tree or file. This file systeme entity may or may not exist. If it does, its contents are overwritten.
srcDetector - the object used to detect any archive files in the source path.
dstDetector - the object used to detect any archive files in the destination path.
Throws:
IOException - if the source path contains the destination path or an elementary operation fails for any reason.

cp_r0

private static void cp_r0(boolean preserve,
                          File src,
                          File dst,
                          TArchiveDetector srcDetector,
                          TArchiveDetector dstDetector)
                   throws IOException
Throws:
IOException

cp

public static void cp(boolean preserve,
                      File src,
                      File dst)
               throws IOException
Copies a single source file to a destination file. The name of this method is inspired by the Unix command line utility cp.

Parameters:
preserve - if an elementary cp operation shall cp as much properties of the source file to the destination file, too. Currently, only the last modification time is preserved. Note that this property set may get extended over time.
src - the source file. This file system entity needs to exist.
dst - the destination file. This file systeme entity may or may not exist. If it does, its contents are overwritten.
Throws:
IOException - if the source path contains the destination path or an elementary operation fails for any reason.

cp0

private static void cp0(boolean preserve,
                        File src,
                        File dst)
                 throws IOException
Throws:
IOException

rm_r

public static void rm_r(File node,
                        TArchiveDetector detector)
                 throws IOException
Recursively deletes the given file or directory tree.

Parameters:
node - the file or directory tree to delete recursively.
Throws:
IOException - if an elementary operation fails for any reason.

checkContains

private static void checkContains(File a,
                                  File b)
                           throws IOException
Throws an IOException if and only if the path represented by a contains the path represented by b, where a path is said to contain another path if and only if it is equal or an ancestor of the other path.

Note that this method uses the absolute path of both files as if by calling File.getAbsolutePath().

Parameters:
a - a file.
b - another file.
Throws:
IOException

getInputSocket

static InputSocket<?> getInputSocket(File src,
                                     BitField<FsInputOption> options)

getOutputSocket

static OutputSocket<?> getOutputSocket(File dst,
                                       BitField<FsOutputOption> options,
                                       @CheckForNull
                                       Entry template)

TrueZIP File* 7.0

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.