|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.util.file.Files
public class Files
File utility methods.
| Method Summary | |
|---|---|
static java.lang.String |
basePath(java.lang.String path,
java.lang.String extension)
Strips off the given extension (probably returned from Files.extension()) from the path, yielding a base pathname. |
static java.lang.String |
cleanupFilename(java.lang.String filename)
Replaces commonly unsupported characters with '_' |
static java.lang.String |
extension(java.lang.String path)
Gets extension from path |
static java.lang.String |
filename(java.lang.String path)
Gets filename from path |
static boolean |
remove(java.io.File file)
Deletes a file, dealing with a particularly nasty bug on Windows. |
static int |
writeTo(java.io.File file,
java.io.InputStream input)
Writes the given input stream to the given file |
static int |
writeTo(java.io.File file,
java.io.InputStream input,
int bufSize)
Writes the given input stream to the given file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String basePath(java.lang.String path,
java.lang.String extension)
path - The path, possibly with an extension to stripextension - The extension to strip, or null if no extension exists
public static java.lang.String extension(java.lang.String path)
path - The path
public static java.lang.String filename(java.lang.String path)
path - The path
public static boolean remove(java.io.File file)
file - File to delete
public static final int writeTo(java.io.File file,
java.io.InputStream input)
throws java.io.IOException
file - The file to write toinput - The input
java.io.IOException
public static final int writeTo(java.io.File file,
java.io.InputStream input,
int bufSize)
throws java.io.IOException
file - The file to write toinput - The inputbufSize - The memory buffer size. 4096 is a good value.
java.io.IOExceptionpublic static final java.lang.String cleanupFilename(java.lang.String filename)
Replaces commonly unsupported characters with '_'
filename - to be cleaned
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||