Class PathResolverProperty
java.lang.Object
com.infoteria.asteria.flowlibrary2.property.ValueProperty
com.infoteria.asteria.flowlibrary2.property.StringProperty
com.infoteria.asteria.flowlibrary2.property.PathResolverProperty
ファイルパスを解決するプロパティです。
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int不正なプロパティ値static final intMode - 相対パスの起点がホームディレクトリstatic final intMode - 相対パスの起点がプロジェクトフォルダstatic final String相対パスの起点が実行ユーザーのホームディレクトリであることをあらわす文字列(ExecuteUser)static final String相対パスの起点がホームディレクトリであることをあらわす文字列(ProjectOwner)static final String相対パスの起点がプロジェクトフォルダであることをあらわす文字列(Relative)static final intMode - 相対パスの起点が実行ユーザーのホームディレクトリ -
Constructor Summary
ConstructorsConstructorDescriptionPathResolverProperty(String name, String defValue) プロパティ名とデフォルト値を指定してPathResolverPropertyを作成します。 -
Method Summary
Modifier and TypeMethodDescriptionvoidこのプロパティの内容を引数のPropertyにコピーします。
引数となるPropertyのクラスはメソッド呼び出しを行うクラスと同一でなければなりません。getExistFile(ExecuteContext context, String path) pathの表すFileオブジェクトを返します。
返されたFileが存在しない場合はExceptionになります。getFile(ExecuteContext context, String str) strの表すFileオブジェクトを返します。
相対パスはモードによって解決されます。getFilePath(ExecuteContext context, String path) pathの表すFileの絶対パスをStringで返します。intgetMode()モードを返します。boolean絶対パスの使用を許すかどうかを返します。boolean「..」の使用を許すかどうかを返します。voidsetAllowAbsolute(boolean b) 絶対パスの使用を許すかどうかを設定します。voidsetAllowUpDir(boolean b) 「..」の使用を許すかどうかを設定します。voidコンパイル時に値を設定します。static intMethods inherited from class com.infoteria.asteria.flowlibrary2.property.StringProperty
setValue, strValueMethods inherited from class com.infoteria.asteria.flowlibrary2.property.ValueProperty
clone, getName, getType, getValue, getValueType, init, isMapable, isNull, isRequired, resetMacro, setRequired, toString
-
Field Details
-
INVALID
public static final int INVALID不正なプロパティ値- See Also:
-
RELATIVE
public static final int RELATIVEMode - 相対パスの起点がプロジェクトフォルダ- See Also:
-
OWNER_HOME
public static final int OWNER_HOMEMode - 相対パスの起点がホームディレクトリ- See Also:
-
USER_HOME
public static final int USER_HOMEMode - 相対パスの起点が実行ユーザーのホームディレクトリ- See Also:
-
STR_RELATIVE
相対パスの起点がプロジェクトフォルダであることをあらわす文字列(Relative)- See Also:
-
STR_PROJECT_OWNER
相対パスの起点がホームディレクトリであることをあらわす文字列(ProjectOwner)- See Also:
-
STR_EXECUTE_USER
相対パスの起点が実行ユーザーのホームディレクトリであることをあらわす文字列(ExecuteUser)- See Also:
-
-
Constructor Details
-
PathResolverProperty
プロパティ名とデフォルト値を指定してPathResolverPropertyを作成します。
-
-
Method Details
-
strToMode
-
isAllowAbsolute
public boolean isAllowAbsolute()絶対パスの使用を許すかどうかを返します。 -
setAllowAbsolute
public void setAllowAbsolute(boolean b) 絶対パスの使用を許すかどうかを設定します。 -
isAllowUpDir
public boolean isAllowUpDir()「..」の使用を許すかどうかを返します。 -
setAllowUpDir
public void setAllowUpDir(boolean b) 「..」の使用を許すかどうかを設定します。 -
setString
Description copied from class:ValuePropertyコンパイル時に値を設定します。- Overrides:
setStringin classValueProperty- Parameters:
str- プロパティ値として設定される文字列- Throws:
PropertyException
-
getMode
public int getMode()モードを返します。 -
getFile
strの表すFileオブジェクトを返します。
相対パスはモードによって解決されます。- Throws:
PropertyException
-
getFile
- Throws:
PropertyException
-
getExistFile
public File getExistFile(ExecuteContext context, String path) throws PropertyException, FileNotFoundException pathの表すFileオブジェクトを返します。
返されたFileが存在しない場合はExceptionになります。 -
getFilePath
pathの表すFileの絶対パスをStringで返します。- Throws:
PropertyException
-
assign
Description copied from interface:Propertyこのプロパティの内容を引数のPropertyにコピーします。
引数となるPropertyのクラスはメソッド呼び出しを行うクラスと同一でなければなりません。- Specified by:
assignin interfaceProperty- Overrides:
assignin classValueProperty
-