|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.geeboss.util.FileUtil
public class FileUtil
Utility methods for files
| Field Summary | |
|---|---|
static int |
OP_ABORTED
FileShop constant: Operation was aborted |
static int |
OP_FAILED
FileShop constant: Operation failed |
static int |
OP_SUCCESSFULL
FileShop constant: Operation was successfull |
| Method Summary | |
|---|---|
static void |
copy(java.io.FileInputStream inputStream,
java.io.FileOutputStream outputStream)
Copy one file to another |
static void |
copy(java.lang.String src,
java.lang.String dest)
Copy one file to another |
static boolean |
copyManifestFiles(java.lang.String toPath)
Copys java.exe.manifest and javaw.exe.manifest to the java.home/bin/ directory, if not yet copyd. |
static void |
copyStreams(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Copy one stream to another |
static boolean |
exists(java.lang.String path)
Check if the given Path points to an existing file. |
static boolean |
exportUserSettings()
Open a FileDialog for the user to choose where to export the "user.xml" |
static java.lang.String |
fileToString(java.io.File file)
Read a file into a String using ISO-8859-1 encoding |
static java.lang.String |
fileToString(java.io.File file,
java.lang.String encoding)
Read a file into a String |
static java.lang.String |
getContent(java.io.InputStream inS)
Read the contents from an InputStream into a String. |
static java.lang.String |
getContent(java.net.URL url)
Read the contents from an URL into a String. |
static java.lang.String |
getFilePath(int style)
Get a path to a file from the user |
static java.lang.String |
getFilePath(int style,
java.lang.String path)
Get a path to a file from the user |
static java.lang.String |
getFilePath(java.lang.String[] formats,
int style)
Get the FilePath from the user |
static java.lang.String |
getFilePath(java.lang.String[] formats,
java.lang.String fileName,
int style,
java.lang.String path)
Get a path to a file from the user |
static java.lang.String |
getSavePath(java.lang.String fileName,
java.lang.String format)
Get the FilePath from the user to save the file |
static int |
importUserSettings()
Open a FileDialog for the user to choose from which file the settings should be imported |
static boolean |
isMediumWriteable(java.io.File file)
Test if the medium from where Geeboss is executed is writeable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OP_ABORTED
public static final int OP_FAILED
public static final int OP_SUCCESSFULL
| Method Detail |
|---|
public static void copyStreams(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
throws java.io.IOException
inputStream - the source streamoutputStream - the destination stream
java.io.IOException - In case of an IO Error
public static void copy(java.io.FileInputStream inputStream,
java.io.FileOutputStream outputStream)
throws java.io.IOException
inputStream - the source streamoutputStream - the destination stream
java.io.IOException - In case of an IO Error
public static void copy(java.lang.String src,
java.lang.String dest)
throws java.io.IOException
src - The path of the sourcefiledest - The path of the destinationfile
java.io.IOException - In case of an IO Error
public static java.lang.String fileToString(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
file - the file to read
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String fileToString(java.io.File file,
java.lang.String encoding)
throws java.io.FileNotFoundException,
java.io.IOException
file - the file to read
java.io.FileNotFoundException
java.io.IOExceptionpublic static boolean copyManifestFiles(java.lang.String toPath)
toPath - Path to copy to
public static boolean exists(java.lang.String path)
path - The path to check.
public static boolean exportUserSettings()
throws java.io.IOException
java.io.IOException - If an IO Error occurspublic static java.lang.String getContent(java.io.InputStream inS)
inS - Any InputStream (e.g. from an URL)
public static java.lang.String getContent(java.net.URL url)
throws java.io.IOException
url - Any valid URL that is online
java.io.IOException - If an error occurspublic static java.lang.String getFilePath(int style)
style - Either SWT.OPEN or SWT.SAVE
public static java.lang.String getFilePath(int style,
java.lang.String path)
style - Either SWT.OPEN or SWT.SAVEpath - If not NULL browser into given directory
public static java.lang.String getFilePath(java.lang.String[] formats,
int style)
formats - Preselected formatsstyle - The style of the FontDialog
public static java.lang.String getFilePath(java.lang.String[] formats,
java.lang.String fileName,
int style,
java.lang.String path)
formats - List of selectable file extensionsfileName - The preselected filename for the dialogstyle - Either SWT.OPEN or SWT.SAVEpath - If not NULL browser into given directory
public static java.lang.String getSavePath(java.lang.String fileName,
java.lang.String format)
fileName - Preselected filenameformat - Format of the file to save
public static int importUserSettings()
throws java.io.IOException
java.io.IOException - If an IO Error occurspublic static boolean isMediumWriteable(java.io.File file)
file - A file to write
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||