cz.vity.freerapid.utilities
Class FileUtils

java.lang.Object
  extended by cz.vity.freerapid.utilities.FileUtils

public class FileUtils
extends Object

Author:
Ladislav Vitasek

Field Summary
static String BACKUP_EXTENSION
           
 
Method Summary
static void copyfile(File srcFile, File dstFile)
           
static OutputStream createEmptyFile(File f, long size, DownloadTask task)
          Vytvori prazdny soubor o dane velikosti vyplneny nulami.
static String getAbsolutPath(File file)
           
static String getAbsolutPath(String path)
           
static File getBackupFile(File srcFile)
           
static File getRelativeDirectory(File base, File file)
           
static void makeBackup(File srcFile)
           
static void renewBackup(File srcFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKUP_EXTENSION

public static final String BACKUP_EXTENSION
See Also:
Constant Field Values
Method Detail

createEmptyFile

public static OutputStream createEmptyFile(File f,
                                           long size,
                                           DownloadTask task)
                                    throws IOException
Vytvori prazdny soubor o dane velikosti vyplneny nulami. Soubor vytvari zapisem v bufferu o velikosti 1MB.

Parameters:
f - soubor
size - velikost
task - running task
Returns:
soubor pro zapis nahodnych dat - nastaveny na zacatek
Throws:
IOException - vyjimka pri IO

makeBackup

public static void makeBackup(File srcFile)
                       throws IOException
Throws:
IOException

renewBackup

public static void renewBackup(File srcFile)
                        throws IOException
Throws:
IOException

getBackupFile

public static File getBackupFile(File srcFile)

getRelativeDirectory

public static File getRelativeDirectory(File base,
                                        File file)

copyfile

public static void copyfile(File srcFile,
                            File dstFile)
                     throws IOException
Throws:
IOException

getAbsolutPath

public static String getAbsolutPath(String path)

getAbsolutPath

public static String getAbsolutPath(File file)