public class BaggerFileEntity
extends java.lang.Object
In order to create a bag, all data files to be included are copied to the bag data dir. If they already exist they are written over, or deleted if marked as isIncluded=false.
If the file comes from a pre-existing bag, then the rootSrc and bagSrc will be the same, and isInBag=true, otherwise it comes from somewhere else and needs to be placed in the current bag.
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
BaggerFileEntity() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
copyRootToBag() |
java.io.File |
getBagSrc() |
boolean |
getIsInBag() |
boolean |
getIsIncluded() |
java.io.File |
getRootParent() |
java.io.File |
getRootSrc() |
static java.lang.String |
normalize(java.lang.String filename) |
static java.lang.String |
removeBasePath(java.lang.String basePath,
java.lang.String filename) |
static java.lang.String |
removeFileExtension(java.lang.String filename) |
void |
setBagSrc(java.io.File file) |
void |
setBagSrc(java.io.File bagDir,
java.io.File src) |
void |
setIsInBag(boolean b) |
void |
setIsIncluded(boolean b) |
void |
setNormalizedName(java.lang.String name) |
void |
setRootParent(java.io.File file) |
void |
setRootSrc(java.io.File file) |
java.lang.String |
toString() |
public java.lang.String toString()
toString in class java.lang.Objectpublic void setNormalizedName(java.lang.String name)
name - Stringpublic void setRootParent(java.io.File file)
file - Filepublic java.io.File getRootParent()
public void setRootSrc(java.io.File file)
file - Filepublic java.io.File getRootSrc()
public void setBagSrc(java.io.File bagDir,
java.io.File src)
bagDir - Filesrc - Filepublic void setBagSrc(java.io.File file)
file - Filepublic java.io.File getBagSrc()
public void setIsInBag(boolean b)
b - booleanpublic boolean getIsInBag()
public void setIsIncluded(boolean b)
b - booleanpublic boolean getIsIncluded()
public boolean copyRootToBag()
public static java.lang.String removeBasePath(java.lang.String basePath,
java.lang.String filename)
throws java.lang.RuntimeException
basePath - Stringfilename - Stringjava.lang.RuntimeException - RuntimeExceptionpublic static java.lang.String removeFileExtension(java.lang.String filename)
throws java.lang.RuntimeException
filename - Stringjava.lang.RuntimeException - RuntimeExceptionpublic static java.lang.String normalize(java.lang.String filename)
filename - String