com.infoteria.asteria.flowlibrary2.property
Class PathResolverProperty

java.lang.Object
  |
  +--com.infoteria.asteria.flowlibrary2.property.ValueProperty
        |
        +--com.infoteria.asteria.flowlibrary2.property.StringProperty
              |
              +--com.infoteria.asteria.flowlibrary2.property.PathResolverProperty
All Implemented Interfaces:
java.lang.Cloneable, Property

public class PathResolverProperty
extends StringProperty

ファイルパスを解決するプロパティです。


Field Summary
static int INVALID
          不正なプロパティ値
static int OWNER_HOME
          Mode - 相対パスの起点がホームディレクトリ
static int RELATIVE
          Mode - 相対パスの起点がプロジェクトフォルダ
static java.lang.String STR_EXECUTE_USER
          相対パスの起点が実行ユーザーのホームディレクトリであることをあらわす文字列(ExecuteUser)
static java.lang.String STR_PROJECT_OWNER
          相対パスの起点がホームディレクトリであることをあらわす文字列(ProjectOwner)
static java.lang.String STR_RELATIVE
          相対パスの起点がプロジェクトフォルダであることをあらわす文字列(Relative)
static int USER_HOME
          Mode - 相対パスの起点が実行ユーザーのホームディレクトリ
 
Constructor Summary
PathResolverProperty(java.lang.String name, java.lang.String defValue)
          プロパティ名とデフォルト値を指定してPathResolverPropertyを作成します。
 
Method Summary
 void assign(Property prop)
           
 java.io.File getExistFile(ExecuteContext context, java.lang.String path)
          pathの表すFileオブジェクトを返します。
返されたFileが存在しない場合はExceptionになります。
 java.io.File getFile(ExecuteContext context, java.lang.String str)
          strの表すFileオブジェクトを返します。
相対パスはモードによって解決されます。
 java.io.File getFile(User user, java.lang.String dir, java.lang.String str)
           
 java.lang.String getFilePath(ExecuteContext context, java.lang.String path)
          pathの表すFileの絶対パスをStringで返します。
 int getMode()
          モードを返します。
 boolean isAllowAbsolute()
          絶対パスの使用を許すかどうかを返します。
 boolean isAllowUpDir()
          「..」の使用を許すかどうかを返します。
 void setAllowAbsolute(boolean b)
          絶対パスの使用を許すかどうかを設定します。
 void setAllowUpDir(boolean b)
          「..」の使用を許すかどうかを設定します。
 void setString(java.lang.String str)
           
static int strToMode(java.lang.String s)
           
 
Methods inherited from class com.infoteria.asteria.flowlibrary2.property.StringProperty
setValue, strValue
 
Methods inherited from class com.infoteria.asteria.flowlibrary2.property.ValueProperty
clone, getName, getType, getValue, getValueType, init, isMapable, isNull, isRequired, resetMacro, setRequired, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID

public static final int INVALID
不正なプロパティ値

RELATIVE

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

OWNER_HOME

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

USER_HOME

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

STR_RELATIVE

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

STR_PROJECT_OWNER

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

STR_EXECUTE_USER

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

PathResolverProperty

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

strToMode

public static int strToMode(java.lang.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(java.lang.String str)
               throws PropertyException
Description copied from class: ValueProperty
コンパイル時に値を設定します。
Overrides:
setString in class ValueProperty
Following copied from class: com.infoteria.asteria.flowlibrary2.property.ValueProperty
Parameters:
str - プロパティ値として設定される文字列

getMode

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

getFile

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

getFile

public java.io.File getFile(User user,
                            java.lang.String dir,
                            java.lang.String str)
                     throws PropertyException

getExistFile

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

getFilePath

public java.lang.String getFilePath(ExecuteContext context,
                                    java.lang.String path)
                             throws PropertyException
pathの表すFileの絶対パスをStringで返します。

assign

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