|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutils.FileUtils
public final class FileUtils
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static void |
copyFromJAR(java.lang.String fromStr,
java.lang.String toFile)
Copies from one file to another |
static java.lang.String |
escapeFilename(java.lang.String s)
|
static java.nio.charset.Charset |
getCharset(java.io.File f)
Naive charset autodetector. |
static java.lang.String |
getExtension(java.io.File f)
Returns the extension (last string after the ".") of a file |
static javax.swing.filechooser.FileFilter |
getFileFilter(java.lang.String extension,
java.lang.String description)
Returns a custom FileFilter that accepts the files with the given extension |
static javax.swing.ImageIcon |
getImage(java.lang.String imgPath)
Returns an image inside "img" folder |
static java.lang.String |
getNameNoExtension(java.io.File f)
Returns the name (the string before the ".") of a file |
static java.lang.String |
showFileChooseSave(java.lang.String[] allowedFormats,
java.lang.String title)
Shows a JFileChooser and let the user choose one of the formats passed to the function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static java.lang.String getExtension(java.io.File f)
f
- File
public static java.lang.String getNameNoExtension(java.io.File f)
f
- File
public static java.nio.charset.Charset getCharset(java.io.File f)
f
- File to be identified
public static java.lang.String escapeFilename(java.lang.String s)
public static java.lang.String showFileChooseSave(java.lang.String[] allowedFormats, java.lang.String title)
allowedFormats
- Array with the extension and descriptions.title
- Title of the dialog
public static javax.swing.filechooser.FileFilter getFileFilter(java.lang.String extension, java.lang.String description)
extension
- Extension of the file to accept, without dotdescription
- Description of this file type
public static void copyFromJAR(java.lang.String fromStr, java.lang.String toFile) throws java.io.IOException
fromFileName
- toFileName
-
java.io.IOException
public static javax.swing.ImageIcon getImage(java.lang.String imgPath)
imgPath
- path of the image inside "img" folder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |