Class SecureFile
This class is used in order to fix all issues related to the Path manipulation fired by the Fortify scans.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilecreateSecureFile(String pathname) Creates a newFileinstance by converting the given pathname string into an abstract pathname.static FilecreateSecureFile(String parent, String child) Creates a newFileinstance from a parent pathname string and a child pathname string.
-
Constructor Details
-
SecureFile
public SecureFile()
-
-
Method Details
-
createSecureFile
Creates a newFileinstance by converting the given pathname string into an abstract pathname. If the given string is the empty string, then the result is the empty abstract pathname.- Parameters:
pathname- A pathname string- Throws:
NullPointerException- If thepathnameargument isnull
-
createSecureFile
Creates a newFileinstance from a parent pathname string and a child pathname string.APP_SYNC_DIRECTORY_NAME If
parentisnullthen the newFileinstance is created as if by invoking the single-argumentFileconstructor on the givenchildpathname string.Otherwise the
parentpathname string is taken to denote a directory, and thechildpathname string is taken to denote either a directory or a file. If thechildpathname string is absolute then it is converted into a relative pathname in a system-dependent way. Ifparentis the empty string then the newFileinstance is created by convertingchildinto an abstract pathname and resolving the result against a system-dependent default directory. Otherwise each pathname string is converted into an abstract pathname and the child abstract pathname is resolved against the parent.- Parameters:
parent- The parent pathname stringchild- The child pathname string- Throws:
NullPointerException- Ifchildisnull
-