Class PathResolverProperty

All Implemented Interfaces:
Property, Cloneable

public class PathResolverProperty extends StringProperty
ファイルパスを解決するプロパティです。
  • Field Details

    • INVALID

      public static final int INVALID
      不正なプロパティ値
      See Also:
    • RELATIVE

      public static final int RELATIVE
      Mode - 相対パスの起点がプロジェクトフォルダ
      See Also:
    • OWNER_HOME

      public static final int OWNER_HOME
      Mode - 相対パスの起点がホームディレクトリ
      See Also:
    • USER_HOME

      public static final int USER_HOME
      Mode - 相対パスの起点が実行ユーザーのホームディレクトリ
      See Also:
    • STR_RELATIVE

      public static final String STR_RELATIVE
      相対パスの起点がプロジェクトフォルダであることをあらわす文字列(Relative)
      See Also:
    • STR_PROJECT_OWNER

      public static final String STR_PROJECT_OWNER
      相対パスの起点がホームディレクトリであることをあらわす文字列(ProjectOwner)
      See Also:
    • STR_EXECUTE_USER

      public static final String STR_EXECUTE_USER
      相対パスの起点が実行ユーザーのホームディレクトリであることをあらわす文字列(ExecuteUser)
      See Also:
  • Constructor Details

    • PathResolverProperty

      public PathResolverProperty(String name, String defValue)
      プロパティ名とデフォルト値を指定してPathResolverPropertyを作成します。
  • Method Details

    • strToMode

      public static int strToMode(String s)
    • isAllowAbsolute

      public boolean isAllowAbsolute()
      絶対パスの使用を許すかどうかを返します。
    • setAllowAbsolute

      public void setAllowAbsolute(boolean b)
      絶対パスの使用を許すかどうかを設定します。
    • isAllowUpDir

      public boolean isAllowUpDir()
      「..」の使用を許すかどうかを返します。
    • setAllowUpDir

      public void setAllowUpDir(boolean b)
      「..」の使用を許すかどうかを設定します。
    • setString

      public void setString(String str) throws PropertyException
      Description copied from class: ValueProperty
      コンパイル時に値を設定します。
      Overrides:
      setString in class ValueProperty
      Parameters:
      str - プロパティ値として設定される文字列
      Throws:
      PropertyException
    • getMode

      public int getMode()
      モードを返します。
    • getFile

      public File getFile(ExecuteContext context, String str) throws PropertyException
      strの表すFileオブジェクトを返します。
      相対パスはモードによって解決されます。
      Throws:
      PropertyException
    • getFile

      public File getFile(User user, String dir, String str) throws PropertyException
      Throws:
      PropertyException
    • getExistFile

      public File getExistFile(ExecuteContext context, String path) throws PropertyException, FileNotFoundException
      pathの表すFileオブジェクトを返します。
      返されたFileが存在しない場合はExceptionになります。
      Throws:
      PropertyException
      FileNotFoundException
    • getFilePath

      public String getFilePath(ExecuteContext context, String path) throws PropertyException
      pathの表すFileの絶対パスをStringで返します。
      Throws:
      PropertyException
    • assign

      public void assign(Property prop)
      Description copied from interface: Property
      このプロパティの内容を引数のPropertyにコピーします。
      引数となるPropertyのクラスはメソッド呼び出しを行うクラスと同一でなければなりません。
      Specified by:
      assign in interface Property
      Overrides:
      assign in class ValueProperty