public final class PathUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decodeFilname(java.lang.String encoded)
as per https://github.com/jkunze/bagitspec/commit/152d42f6298b31a4916ea3f8f644ca4490494070 decode percent encoded filenames
|
static java.lang.String |
encodeFilename(java.nio.file.Path path)
as per https://github.com/jkunze/bagitspec/commit/152d42f6298b31a4916ea3f8f644ca4490494070 encode any new lines or carriage returns
|
static java.lang.String |
generatePayloadOxum(java.nio.file.Path dataDir)
Calculate the total file and byte count of the files in the payload directory
|
static java.nio.file.Path |
getBagitDir(Bag bag)
With bagit version 2.0 (.bagit) bagit specific files are no longer at the bag root directory.
|
static java.nio.file.Path |
getBagitDir(Version version,
java.nio.file.Path bagRoot)
With bagit version 2.0 (.bagit) bagit specific files are no longer at the bag root directory.
|
static java.nio.file.Path |
getDataDir(Bag bag)
With bagit version 2.0 (.bagit)
payload files are no longer in the "data" directory.
|
static java.nio.file.Path |
getDataDir(Version version,
java.nio.file.Path output)
With bagit version 2.0 (.bagit)
payload files are no longer in the "data" directory.
|
static java.lang.String |
getFilename(java.nio.file.Path path)
Needed to get rid of findbugs "dodgy code warnings" in regards to getting the filename of a path as a string
|
static boolean |
isHidden(java.nio.file.Path path)
Due to the way that windows handles hidden files vs.
|
public static java.lang.String getFilename(java.nio.file.Path path)
path - the path that you which to get the filename as a stringpublic static java.lang.String decodeFilname(java.lang.String encoded)
encoded - the encoded filenamepublic static java.lang.String encodeFilename(java.nio.file.Path path)
path - the path to encodepublic static boolean isHidden(java.nio.file.Path path)
throws java.io.IOException
path - the file or folder to check if hiddenjava.io.IOException - if there is an error reading the file/folderpublic static java.nio.file.Path getDataDir(Bag bag)
bag - that contains the payload files you wantpublic static java.nio.file.Path getDataDir(Version version, java.nio.file.Path output)
version - the bag versionoutput - where the bag is being or was written topublic static java.nio.file.Path getBagitDir(Bag bag)
bag - the bagpublic static java.nio.file.Path getBagitDir(Version version, java.nio.file.Path bagRoot)
version - the bag versionbagRoot - the root directory of the bagpublic static java.lang.String generatePayloadOxum(java.nio.file.Path dataDir)
throws java.io.IOException
dataDir - the directory to calculate the payload-oxumjava.io.IOException - if there is an error reading any of the files