public static class FileFunctions.FilePathnameExt
extends java.lang.Object
D:/path/to/file.zip:path/inZip/content.xml".
The colon behind the 2th position separates the path to the zip file and the path inside the zip file.
Use parseZipPath(File, String, char) to evaluate it.| Modifier and Type | Field and Description |
|---|---|
java.io.File |
file
May be a zip file.
|
java.lang.String |
sExt
May be the path in the zip file to the file.
|
java.lang.String |
sNamePath
May be the path in the zip file to the file.
|
| Constructor and Description |
|---|
FilePathnameExt(java.io.File dirOrZipfile,
java.lang.String sNameOrPathInZip)
Creates an instance typically to describe a File wit path in zip and the zip file
but also usable to describe a directory and the name of the file.
|
FilePathnameExt(java.io.File dir,
java.lang.String sNameStart,
java.lang.String sExt)
Creates an instance typically to describe a directory and the start name and the extension of the file.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
newFileFromDirName(java.io.File fOther)
Creates a file from parsed
parseDirWildcardName(File, String) and a given other file. |
static FileFunctions.FilePathnameExt |
parseDirWildcardName(java.io.File currDir,
java.lang.String sArg)
Parse one argument for a file as directory and the parts of a file name for a file to create.
|
static int |
parseWildcardZipPath(java.util.Collection<FileFunctions.FilePathnameExt> add,
java.io.File currDir,
java.lang.String sArg,
char cSep)
Parse one argument for possible some file given with wildcards and one possible zip entry, each the same in each file.
|
static FileFunctions.FilePathnameExt |
parseZipPath(java.io.File currDir,
java.lang.String sArg,
char cSep)
Parse one argument for a file and possible zip entry
|
java.lang.String |
toString() |
public final java.io.File file
public final java.lang.String sNamePath
public final java.lang.String sExt
public FilePathnameExt(java.io.File dir,
java.lang.String sNameStart,
java.lang.String sExt)
newFileFromDirName(File) or user specific.
It is also possible to describe more as one file in a zip with wildcards.dir - sNameStart - if sExt is given, after them the wildcard symbol should be thought.sExt - public FilePathnameExt(java.io.File dirOrZipfile,
java.lang.String sNameOrPathInZip)
dirOrZipfile - sNameOrPathInZip - public static FileFunctions.FilePathnameExt parseZipPath(java.io.File currDir, java.lang.String sArg, char cSep) throws java.io.FileNotFoundException
currDir - can be null, may be given for a relative path.sArg - the given argument. The zip entry is separated with 'cSep' after the 2th position.
for example "D:\path\to\file.zip:path/inZip"cSep - separator char before path in zip, recommended use a colon ':'file is the zip file, File.exists() is not tested.
#sNamePath is the relative path in the zip file for the entry (part after 'cSep').java.io.FileNotFoundExceptionpublic static int parseWildcardZipPath(java.util.Collection<FileFunctions.FilePathnameExt> add, java.io.File currDir, java.lang.String sArg, char cSep) throws java.io.FileNotFoundException
add - the container to add, it can be a ListcurrDir - can be null, may be given for a relative path.sArg - the given argument. The zip entry is separated with 'cSep' after the 2th position.
for example "D:\path\to\*.zip:path/inZip"cSep - separator char before path in zip, recommended use a colon ':'file is the zip file, File.exists() is not tested.
#sNamePath is the relative path in the zip file for the entry (part after 'cSep').java.io.FileNotFoundExceptionpublic static FileFunctions.FilePathnameExt parseDirWildcardName(java.io.File currDir, java.lang.String sArg) throws java.io.FileNotFoundException
currDir - can be null, may be given for a relative pathsArg - the given argument. Possible: "path/to/name*.ext"
FileFunctions.newFile(File, String, boolean) with the 'currDir' as first argument.
With that return value file is set as resulting current dir
from this argument and the 'currdir' argument.
Note that it is possible using environment variables for that,
and "~/..." for home and "/tmp/..." also for the Windows-%TMP% dir.
file is set with the given 'currDir',
means null if null is given for 'currDir'.
sNamePath is set with the file name before '*'
and sExt is set with teh part after '*'.
sExt := null and sNamePath := sArg.
file is the directory of the given path or remain null.
File.exists() is not tested.
sNamePath is the name till '*' or the whole name, it is "" if "path/to/*.ext" is given.
It is also "" if sArg is given with ending slash or backslash.
sExt is the part after the * or null if a * is not given.java.io.FileNotFoundException - can occur if the absolute directory is created.public java.io.File newFileFromDirName(java.io.File fOther)
parseDirWildcardName(File, String) and a given other file.fOther - the other file which's name without extension dedicates the name of the new filefile
public java.lang.String toString()
toString in class java.lang.Object