|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfileapart.chopAndMergeFiles
public class chopAndMergeFiles
| Field Summary | |
|---|---|
static java.lang.String |
CHOP_AND_MERGE_FILES_COPYRIGHT
Copyright information |
static int |
RET_ALL
A return status code - All |
static int |
RET_NO
A return status code - No |
static int |
RET_YES
A return status code - Yes |
| Constructor Summary | |
|---|---|
chopAndMergeFiles()
Sets some internal values, like the size of the internal buffer, and displays the version and copyright information. |
|
| Method Summary | |
|---|---|
protected boolean |
checkFileOverwrite(java.lang.String filename)
checks whether a "overwrite file?" dialog is to be launched. |
boolean |
checkMandatoriesForAssembling()
Checks if all necessary strings are set. |
boolean |
checkMandatoriesForChopping()
Checks whether all mandatory input variables for the chopping of a file are set. |
protected int |
checkOrFillList(java.io.File[] fileList,
boolean create)
Creates a list of fragment files. |
boolean |
chopFile(boolean verboseOutput)
chopFile tries to write all fragment files into the desired fragment file folder. |
void |
chopTestOutput()
Displays the current state of the some internal parameters regarding the process of creating fragment files. |
protected boolean |
createFragFilename(int i)
Example: FileToChop == "hello.img", FragDestDir == "/home/user/frag". |
protected boolean |
createFragList()
creates the internal fragment file list. |
java.lang.String |
getOSLanguage()
tries to determine the language of the operating system. |
protected boolean |
getPos()
Checks whether the current channel position can be accessed. |
boolean |
initFileAssembly()
Performs inital tests and calculations. |
boolean |
initFileChopping()
Performs inital tests and calculations. |
protected boolean |
isFirstFragFile(java.lang.String fileName)
Checks whether the file name ends with "part.000". |
protected boolean |
isVoidString(java.lang.String s)
Checks whether s==null or s is empty. |
int |
launchOverwriteDialog(java.lang.String fname)
|
void |
mergeTestOutput()
|
void |
onExit()
Calls System.exit(0). |
boolean |
reassembleFile(boolean verboseOutput)
Reassembles the original file from the given fragment files. |
void |
setFileDestDir(java.lang.String FileDestDir)
Sets the folder in which the reassembled (the original) file will be stored. |
void |
setFileToChop(java.lang.String FileToChop)
Sets the absolute path of the file to be chopped into fragments. |
void |
setFirstFragment(java.lang.String FirstFragment)
Sets the location of the first fragment file |
void |
setFragDestDir(java.lang.String FragDestDir)
Sets the folder which is to contain the generated fragment files. |
void |
setFragSize(long FragSize)
Sets the maximal fragment file size in bytes. |
protected boolean |
setOrgFileName(java.io.File firstFragFile)
Extracts the original file name from the name of the first fragment file. |
void |
showMessage(java.lang.String message)
Displays a message to the console. |
protected boolean |
writeFragFile(int i)
Writes a single fragment file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RET_NO
public static final int RET_YES
public static final int RET_ALL
public static final java.lang.String CHOP_AND_MERGE_FILES_COPYRIGHT
| Constructor Detail |
|---|
public chopAndMergeFiles()
| Method Detail |
|---|
public void onExit()
public void setFileToChop(java.lang.String FileToChop)
FileToChop - absolute path of the file to be chopped.public void setFragDestDir(java.lang.String FragDestDir)
FragDestDir - absolute path to the desired folder.public void setFragSize(long FragSize)
FragSize - maximal fragment file size in bytes.public boolean checkMandatoriesForChopping()
public boolean initFileChopping()
protected boolean getPos()
public void chopTestOutput()
protected boolean createFragFilename(int i)
protected boolean writeFragFile(int i)
i - number of the fragment file.
public boolean chopFile(boolean verboseOutput)
verboseOutput - If you set this to true, you'll get inormation about
some internal settings.
public void setFileDestDir(java.lang.String FileDestDir)
FileDestDir - The folder in which the reassembled (the original) file will be stored.public void setFirstFragment(java.lang.String FirstFragment)
FirstFragment - absolute path to the first fragment filepublic boolean checkMandatoriesForAssembling()
protected boolean isFirstFragFile(java.lang.String fileName)
fileName - the file to check
protected boolean setOrgFileName(java.io.File firstFragFile)
firstFragFile - the name of the first fragment file
protected int checkOrFillList(java.io.File[] fileList,
boolean create)
fileList - file list.create - false: get the number of matching files, true: fill the list
protected boolean createFragList()
public boolean initFileAssembly()
public boolean reassembleFile(boolean verboseOutput)
verboseOutput - set this parameter to true if you want to get additional information.
public void mergeTestOutput()
public void showMessage(java.lang.String message)
message - the message to be displayed.public java.lang.String getOSLanguage()
protected boolean isVoidString(java.lang.String s)
s - string to check.
protected boolean checkFileOverwrite(java.lang.String filename)
filename -
public int launchOverwriteDialog(java.lang.String fname)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||