|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikipedia.util.FileWriter
public class FileWriter
Constructor Summary | |
---|---|
FileWriter()
|
Method Summary | |
---|---|
static void |
createDir(String path)
Creates parent directory for the file with the full 'path', if the directory does not exist. |
void |
delete()
|
static boolean |
existsFile(String path)
Checks file existance. |
void |
Flush()
|
String |
GetDir()
|
long |
GetFileLength()
|
String |
GetFilename()
|
String |
GetFilenameWoExt()
Get filename without the extension |
String |
GetPath()
|
void |
Open()
|
void |
Open(boolean b_append,
String encode)
Opens file stream. |
void |
Print(String text)
|
void |
PrintNL(String text)
|
static boolean |
retrieveBinaryFileFromJar(String resource_name,
String target_dir,
Object resource)
Extracts file with name resource_name from the jar, copies it to the target directory target_dir. |
void |
SetAppend(boolean b_new_append)
|
void |
SetDir(String new_dir)
|
void |
SetEncode(String new_encode)
|
void |
setFileInHomeDir(String sub_dir,
String _filename,
String enc,
boolean b_append)
Opens file stream in /user home directory/.synarcher/sub_dir/_filename in encoding enc. |
void |
SetFilename(String new_filename)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileWriter()
Method Detail |
---|
public void SetDir(String new_dir)
public void SetFilename(String new_filename)
public String GetFilename()
public String GetPath()
public String GetDir()
public void SetAppend(boolean b_new_append)
public void SetEncode(String new_encode)
public void Open()
public void Open(boolean b_append, String encode)
b_append
- if true
, then bytes will be written
to the end of the file rather than the beginningpublic void delete()
public void Print(String text)
public void PrintNL(String text)
public void Flush()
public String GetFilenameWoExt()
public long GetFileLength()
public void setFileInHomeDir(String sub_dir, String _filename, String enc, boolean b_append)
b_append
- if true
, then bytes will be written
to the end of the file rather than the beginning
Examples
dump.file_dot.setFileInHomeDir("graphviz", "bat_ruwiki.dot", "Cp866",true);
dump.file_bat.setFileInHomeDir("graphviz", "bat_ruwiki.bat", "Cp866",true);
dump.file_sh.setFileInHomeDir("graphviz", "bat_ruwiki.sh", "Cp1251", true);public static boolean existsFile(String path)
public static void createDir(String path)
public static boolean retrieveBinaryFileFromJar(String resource_name, String target_dir, Object resource) throws Exception
target_dir
- target directory, if it is not exists, then mkdir,
e.g. creates `.wiwordik` folder for the
target_dir=".../.wiwordik/enwikt20101030.sqlite"
Exception
http://www.java2s.com/Code/Java/File-Input-Output/RetreiveTextFileFromJar.htm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |