java.lang.Object
com.streamwide.smartms.lib.template.security.SecureFile

public class SecureFile extends Object

This class is used in order to fix all issues related to the Path manipulation fired by the Fortify scans.

  • Constructor Details

    • SecureFile

      public SecureFile()
  • Method Details

    • createSecureFile

      @Nullable public static File createSecureFile(@NonNull String pathname)
      Creates a new File instance 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 the pathname argument is null
    • createSecureFile

      @NonNull public static File createSecureFile(@Nullable String parent, @NonNull String child)
      Creates a new File instance from a parent pathname string and a child pathname string.

      APP_SYNC_DIRECTORY_NAME If parent is null then the new File instance is created as if by invoking the single-argument File constructor on the given child pathname string.

      Otherwise the parent pathname string is taken to denote a directory, and the child pathname string is taken to denote either a directory or a file. If the child pathname string is absolute then it is converted into a relative pathname in a system-dependent way. If parent is the empty string then the new File instance is created by converting child into 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 string
      child - The child pathname string
      Throws:
      NullPointerException - If child is null