java.lang.Objectucot.utils.FileTools
public class FileTools
This class contains some operations for file handling.
Field Summary | |
---|---|
static java.lang.String |
FILE_NOT_FOUND
Message for file not found -situation. |
static java.lang.String |
FILE_NOT_READABLE
Message for file not readable -situation. |
static java.lang.String |
FILE_NOT_WRITABLE
Message for file not writable -situation. |
static java.lang.String |
OPERATION_FORBIDDEN
Message for operation not permited -situation. |
Constructor Summary | |
---|---|
FileTools()
|
Method Summary | |
---|---|
static java.io.File |
changeExtension(java.io.File original,
java.lang.String extension)
Changes given file's extension |
static void |
copyFile(java.io.File from,
java.io.File to)
Method copies file. |
static void |
copyFile(java.lang.String from,
java.lang.String to)
Copies file represented by path to target path. |
static void |
copyFile(java.net.URL from,
java.net.URL to)
Copies file represented by url to the the file represented by anaother url. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_NOT_FOUND
public static final java.lang.String FILE_NOT_READABLE
public static final java.lang.String FILE_NOT_WRITABLE
public static final java.lang.String OPERATION_FORBIDDEN
Constructor Detail |
---|
public FileTools()
Method Detail |
---|
public static void copyFile(java.io.File from, java.io.File to) throws java.io.IOException
from
- The source file to copy from. It must exist.to
- The target file or directory.
java.io.IOException
public static void copyFile(java.net.URL from, java.net.URL to) throws java.io.IOException
copyFile(File,File)
-method to perform the actual copy.
from
- The URL of source file.to
- The URL of target file or directory.
java.io.IOException
copyFile(File, File)
public static void copyFile(java.lang.String from, java.lang.String to) throws java.io.IOException
copyFile(File,File)
-method to perform the actual copy.
from
- The path of the source file.to
- The path of the target file or directory.
java.io.IOException
copyFile(File, File)
public static java.io.File changeExtension(java.io.File original, java.lang.String extension)
original
- original fileextension
- new extension for the file