001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.hayabusa.taglib;
017    
018    import org.opengion.hayabusa.common.HybsSystem;
019    import org.opengion.hayabusa.common.HybsSystemException;
020    import org.opengion.fukurou.util.FileString;
021    import org.opengion.fukurou.util.FileUtil;
022    
023    import org.opengion.fukurou.util.StringUtil ;
024    import static org.opengion.fukurou.util.StringUtil.nval ;
025    
026    import java.io.IOException;
027    import java.io.File;
028    
029    /**
030     * å�?¨®アクションを指定して、ファイル関連の操作をおこなã�?‚¿グですã?
031     *
032     * å�?¨®アクション に応じた振るè?ã�?‚’行いますã?
033     * 結果につã�?�¦は、false の場合ã?,body 要ç´?‚’表示して、終äº?�—ますã?
034     * 判定結果を反転したã�??合ã?、notEquals 属æ?を使用してください。またã?
035     * 結果に応じて、å?ç�?‚’止めたくなã�??合ã?、useStop 属æ?ã‚?false にæŒ?®šすることでã€?
036     * 後続å?ç�?‚’実行できますã?
037     *
038     * [å�?¨®アクション]
039     * canRead          読み込めるかどã�?�‹を判定ã?
040     * canWrite         変更できるかどã�?�‹判定ã?
041     * createNewFile    空の新しいファイルを不可åˆ?(atomic) に生æ?ã€?そã?ファイルがまã�?­˜在しなã�??合だã�?
042     * delete           ファイルまたã?ãƒ?‚£レクトリを削除ã€?
043     * renameTo         ファイルまたã?ãƒ?‚£レクトリ名を変更ã€?
044     * exists           ファイルが存在するかどã�?�‹判定ã?
045     * isDirectory      ファイルがディレクトリであるかどã�?�‹判定ã?
046     * isFile           ファイルが普通ã?ファイルかどã�?�‹判定ã?
047     * isHidden         ファイルが隠しファイルかどã�?�‹判定ã?
048     * mkdir            ãƒ?‚£レクトリを生成ã?
049     * mkdirs           ãƒ?‚£レクトリをè¤?•°生æ?ã€?
050     * read             ファイルを読み込んでjspWriterに出åŠ?
051     * existsLength     ファイルサイズが0Byte以上ã?ファイルが存在するかどã�?�‹判定ã?
052     * copy             ファイルまたã?ãƒ?‚£レクトリをコピã?ã€?
053     *
054     * @og.formSample
055     * ●形式ï¼?lt;og:file action="…" fileURL="…" >?¥?¥?¥</og:file>
056     * ●body?šあã‚?EVAL_BODY_INCLUDE:BODYをインクルードし、{@XXXX} は解析しません)
057     *
058     * ●Tag定義??
059     *   <og:file
060     *       fileURL            【TAG】操作するファイルのãƒ?‚£レクトリを指定しまã�?(初期値:FILE_URL[=filetemp/])
061     *       file1              【TAG】基準となるファイル名をæŒ?®šしまã�?コマンドã?左辺のファイル名でã�?
062     *       file2              【TAG】å?ç�?µ�果となるファイル名をæŒ?®šしまã�?コマンドã?右辺のファイル名でã�?
063     *       action           ○ã?TAG】アクション(canRead,canWrite,createNewFile,delete,exists,isDirectory,isFile,isHidden,mkdir,mkdirs)を指定しますã?(å¿??)
064     *       notEquals          【TAG】判定結果を反転させるかどã�?�‹[true/false]を指定しまã�?初期値:false)
065     *       useStop            【TAG】エラーæ™?ODYをå?ç�?¾Œに停止するかどã�?�‹[true/false]を指定しまã�?初期値:true)
066     *       encode             【TAG】ファイルを読み込ã‚?action="READ")際ã?エンコードをæŒ?®šしまã�?初期値:OS依存文字コーãƒ?
067     *       debug              【TAG】デバッグæƒ??をå?力するかどã�?�‹[true/false]を指定しまã�?初期値:false)
068     *   >   ... Body ...
069     *   </og:file>
070     *
071     * ●使用ä¾?
072     *    ・ファイルの存在チェãƒ?‚¯→存在しなければエラーメãƒ?‚»ージを表示ã€?
073     *        <og:file action="exists" fileURL="N:/CIR/" file1="{@USER.LKISB}/{@USER.LDNO1KAI}.cir/001.sht">
074     *            <og:message msg="RKE_0157" comment="回路図が存在しませんã€? />
075     *        </og:file>
076     *
077     *    ・N:/Filetemp/にユーザーãƒ?‚£レクトリが存在しなければ作æ?。â?失敗したå?合エラーメãƒ?‚»ージを表示ã€?
078     *        <og:file action="mkdir" fileURL="N:/Filetemp/{@USER.ID}" >
079     *            <og:message comment="エラーが発生しました。シスãƒ?ƒ 管ç�??に連絡してくださいã€? />
080     *        </og:file>
081     *
082     *    ・N:/Filetemp/test.txt ファイルの削除。ファイルが存在しなくてもå?ç�?‚’続けるã?
083     *        <og:file action="delete" fileURL="N:/Filetemp/" file1="test.txt" useStop="false" >
084     *            <og:message comment="ファイルは存在しませんでしたã€? />
085     *        </og:file>
086     *
087     * @og.group そã?他部å“?
088     *
089     * @version  4.0
090     * @author       Kazuhiko Hasegawa
091     * @since    JDK5.0,
092     */
093    public class FileTag extends CommonTagSupport {
094            //* こã?プログラãƒ??VERSIONæ–?­—å?を設定しますã?       {@value} */
095            private static final String VERSION = "5.3.6.0 (2011/06/01)" ;
096    
097            private static final long serialVersionUID = 536020110601L ;
098    
099            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? 読み込めるかどã�?�‹ {@value} */
100            public static final String ACT_CANREAD  = "canRead" ;
101            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? 変更できるかどã�?�‹ {@value} */
102            public static final String ACT_CANWRITE    = "canWrite" ;
103            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? 空の新しいファイルを不可åˆ?(atomic) に生æ?しまã�?(そã?ファイルがまã�?­˜在しなã�??合だã�?{@value} */
104            public static final String ACT_CREATENEWFILE    = "createNewFile" ;
105            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルまたã?ãƒ?‚£レクトリを削除{@value}      */
106            public static final String ACT_DELETE    = "delete" ;
107            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルが存在するかどã�?�‹ {@value} */
108            public static final String ACT_EXISTS    = "exists" ;
109            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルがディレクトリであるかどã�?�‹{@value}   */
110            public static final String ACT_ISDIRECTORY        = "isDirectory" ;
111            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルが普通ã?ファイルかどã�?�‹{@value}       */
112            public static final String ACT_ISFILE    = "isFile" ;
113            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルが隠しファイルかどã�?�‹ {@value} */
114            public static final String ACT_ISHIDDEN    = "isHidden" ;
115            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ãƒ?‚£レクトリを生成しますã? {@value} */
116            public static final String ACT_MKDIR    = "mkdir" ;
117            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ãƒ?‚£レクトリを生成しますã? {@value} */
118            public static final String ACT_MKDIRS   = "mkdirs" ;
119            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイル名を変更しますã? {@value} */
120            public static final String ACT_RENAMETO = "renameTo" ;          // 3.5.6.5 (2004/08/09)
121            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルを読み込んで表示しますã? {@value} */
122            public static final String ACT_READ     = "read" ;              // 3.6.0.0 (2004/09/25)
123            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルサイズが0Byte以上ã?ファイルが存在するかどã�?�‹判定ã? {@value} */
124            public static final String ACT_EXISTSLENGTH      = "existsLength" ;             // 3.8.5.2 (2006/05/31)
125            /** action 引数に渡す事ã?出来ã‚?アクションコマンãƒ? ファイルまたã?ãƒ?‚£レクトリをコピã?しますã? {@value} */
126            public static final String ACT_COPY      = "copy" ;             // 5.3.6.0 (2011/06/01)
127    
128            /** action 引数に渡す事ã?出来ã‚?コマンãƒ?リスãƒ? */
129            private static final String[] ACTION_LIST = new String[] {
130                    ACT_CANREAD , ACT_CANWRITE , ACT_CREATENEWFILE , ACT_DELETE , ACT_EXISTS , ACT_ISDIRECTORY ,
131                    ACT_ISFILE , ACT_ISHIDDEN , ACT_MKDIR , ACT_MKDIRS , ACT_RENAMETO , ACT_READ , ACT_EXISTSLENGTH , ACT_COPY };
132    
133            private String  fileURL         = HybsSystem.sys( "FILE_URL" );
134            private String  file1           = "";
135            private String  file2           = null;
136            private String  action          = null;
137            private boolean rtnCode         = false;
138    
139            private boolean notEquals       = false;        // 3.8.5.2 (2006/05/31) 判定結果を反転させて処ç�?�—ますã?
140            private boolean useStop         = true;         // 3.8.5.2 (2006/05/31) エラーæ™?ODYをå?ç�?¾Œに停止(true)するかどã�?�‹
141    
142            private String encode           = null;         // 5.1.9.0 (2010/08/01) READ時ã?エンコード指å®?
143    
144            /**
145             * Taglibの開始タグが見つかったときに処ç�?�™ã‚?doStartTag() ã‚?オーバã?ライドしますã?
146             *
147             * @og.rev 3.6.0.0 (2004/09/25) file オブジェクトã?作æ?ã‚?actionExec 移å‹?
148             * @og.rev 3.8.5.2 (2006/05/31) notEquals追åŠ?? 判定結果を反転させて処ç�?�—ますã?
149             *
150             * @return      後続å?ç�??æŒ?¤º
151             */
152            @Override
153            public int doStartTag() {
154                    try {
155                            rtnCode = notEquals ^ actionExec( action );             // 3.8.5.2 (2006/05/31) 排他的論理å’?XOR)
156                    }
157                    catch( IOException ex ) {
158                            String errMsg = "æŒ?®šã?アクションは実行できません。アクションエラー"
159                                                            + HybsSystem.CR
160                                                            + "action=[" + action + "] , "
161                                                            + "  fileURL=[" + fileURL + "]"
162                                                            + "  file1=[" + file1 + "]"
163                                                            + "  file2=[" + file2 + "]" ;
164                            throw new HybsSystemException( errMsg,ex );             // 3.5.5.4 (2004/04/15) 引数の並びé ?¤‰更
165                    }
166    
167                    if( rtnCode ) { return(SKIP_BODY); }                    // Body を評価しなã�?
168                    else {                  return( EVAL_BODY_INCLUDE ); }  // Body インクルーãƒ? extends TagSupport æ™?
169            }
170    
171            /**
172             * Taglibの終äº?‚¿グが見つかったときに処ç�?�™ã‚?doEndTag() ã‚?オーバã?ライドしますã?
173             *
174             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()で呼ぶã€?
175             * @og.rev 3.8.5.2 (2006/05/31) useStop 追åŠ?? エラーæ™?ODYをå?ç�?¾Œに停止(true)するかどã�?�‹
176             *
177             * @return      後続å?ç�??æŒ?¤º
178             */
179            @Override
180            public int doEndTag() {
181                    debugPrint();           // 4.0.0 (2005/02/28)
182                    int rtn = ( useStop && !rtnCode ) ? SKIP_PAGE : EVAL_PAGE ;
183    
184                    return( rtn );
185            }
186    
187            /**
188             * タグリブオブジェクトをリリースしますã?
189             * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
190             *
191             * @og.rev 2.0.0.4 (2002/09/27) カスタãƒ?‚¿グの release() メソãƒ?ƒ‰をã?追åŠ?
192             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()で呼ぶã€?
193             * @og.rev 3.6.0.0 (2004/09/24) columns 、tableId 、file 削除
194             * @og.rev 3.8.5.2 (2006/05/31) notEquals 、useStop 追åŠ?
195             * @og.rev 5.1.9.0 (2010/08/01) READ時ã?エンコード指å®?
196             *
197             */
198            @Override
199            protected void release2() {
200                    super.release2();
201                    fileURL         = HybsSystem.sys( "FILE_URL" );
202                    file1           = "";
203                    file2           = null;
204                    action          = null;
205                    rtnCode         = false;
206                    notEquals       = false;        // 3.8.5.2 (2006/05/31) 判定結果を反転させて処ç�?�—ますã?
207                    useStop         = true;         // 3.8.5.2 (2006/05/31) エラーæ™?ODYをå?ç�?¾Œに停止(true)するかどã�?�‹
208                    encode          = null;         // 5.1.9.0 (2010/08/01) READ時ã?エンコード指å®?
209            }
210    
211            /**
212             * アクションを実行しますã?
213             * アクションは,æŒ?®šã?アクションコマンドに対応するå?ç�?‚’入力データに
214             * 対して行いますã?
215             *
216             * @og.rev 3.0.0.0 (2002/12/25) ACTION_LIST のチェãƒ?‚¯を削除
217             * @og.rev 3.6.0.0 (2004/09/25) ACT_read を追åŠ?, file オブジェクトを移å‹?
218             * @og.rev 3.8.5.2 (2006/05/31) existsLength 追åŠ?
219             * @og.rev 4.0.0.0 (2007/11/28) メソãƒ?ƒ‰の戻りå?をチェãƒ?‚¯しますã?
220             * @og.rev 5.1.9.0 (2010/08/01) READ時ã?エンコード指å®?
221             * @og.rev 5.3.6.0 (2011/06/01) ACT_copy 対å¿?
222             *
223             * @param       action アクションコマンãƒ?public static final 宣è¨?�•れてã�?‚‹æ–?­—å?)
224             *
225             * @return      実行後ã?ãƒ??タ
226             */
227            private boolean actionExec( final String action ) throws IOException {
228                    String directory = HybsSystem.url2dir( fileURL );
229                    File file = new File( StringUtil.urlAppend( directory,file1 ) );
230    
231                    boolean rtnVal = false;
232                    if( action != null ) {
233                            if(      ACT_CANREAD.equalsIgnoreCase(           action ) ) { rtnVal = file.canRead(); }
234                            else if( ACT_CANWRITE.equalsIgnoreCase(          action ) ) { rtnVal = file.canWrite(); }
235                            else if( ACT_CREATENEWFILE.equalsIgnoreCase( action ) ) { rtnVal = file.createNewFile(); }
236                            else if( ACT_DELETE.equalsIgnoreCase(            action ) ) { rtnVal = file.delete(); }
237                            else if( ACT_EXISTS.equalsIgnoreCase(            action ) ) { rtnVal = file.exists(); }
238                            else if( ACT_ISDIRECTORY.equalsIgnoreCase(       action ) ) { rtnVal = file.isDirectory(); }
239                            else if( ACT_ISFILE.equalsIgnoreCase(            action ) ) { rtnVal = file.isFile(); }
240                            else if( ACT_ISHIDDEN.equalsIgnoreCase(          action ) ) { rtnVal = file.isHidden(); }
241                            else if( ACT_MKDIR.equalsIgnoreCase(             action ) ) {
242                                    if( file.isDirectory() ) { rtnVal = true; }
243                                    else { rtnVal = file.mkdir(); }
244                            }
245                            else if( ACT_MKDIRS.equalsIgnoreCase(            action ) ) { rtnVal = file.mkdirs(); }
246                            else if( ACT_RENAMETO.equalsIgnoreCase(          action ) ) {
247                                    if( file2 != null ) {
248                                            File newFile = new File( StringUtil.urlAppend( directory,file2 ) );
249    //                                      if( newFile.exists() ) { newFile.delete(); }
250                                            if( newFile.exists() && !newFile.delete() ) {
251                                                    String errMsg = "æ‰?®šã?ファイルを削除できませんでしたã€?" + newFile + "]" ;
252                                                    throw new RuntimeException( errMsg );
253                                            }
254                                            rtnVal = file.renameTo( newFile );
255                                    }
256                            }
257                            // 3.6.0.0 (2004/09/25) ACT_read を追åŠ?
258                            else if( ACT_READ.equalsIgnoreCase(                      action ) ) {
259                                    if( file.isFile() ) {
260                                            FileString fs = new FileString();
261                                            fs.setFilename( StringUtil.urlAppend( directory,file1 ) );
262                                            if( encode != null ) { fs.setEncode( encode ); } // 5.1.9.0 (2010/08/01) READ時ã?エンコード指å®?
263                                            String val = fs.getValue();
264    
265                                            jspPrint( nval( getRequestParameter( val ),"" ) );
266                                            rtnVal = true;
267                                    }
268                                    else {
269                                            String errMsg = "ファイルが存在しなã�?�‹、ファイルではありませんã€?
270                                                            + HybsSystem.CR
271                                                            + "action=[" + action + "] , "
272                                                            + "  fileURL=[" + fileURL + "]"
273                                                            + "  directory=[" + directory + "]"
274                                                            + "  file1=[" + file1 + "]" ;
275                                            throw new HybsSystemException( errMsg );
276                                    }
277                            }
278                            // 3.8.5.2 (2006/05/31) ファイルサイズが0Byte以上ã?ファイルが存在するかどã�?�‹判定ã?
279                            else if( ACT_EXISTSLENGTH.equalsIgnoreCase( action ) ) {
280                                    rtnVal = ( file.exists() && file.length() > 0L );
281                            }
282                            // 5.3.6.0 (2011/06/01) ファイルコピã?対å¿?
283                            else if( ACT_COPY.equalsIgnoreCase( action ) ) {
284                                    if( file2 != null ) {
285                                            File newFile = new File( StringUtil.urlAppend( directory,file2 ) );
286                                            if( file.isFile() ) {
287                                                    rtnVal = FileUtil.copy( file, newFile );
288                                            }
289                                            else if( file.isDirectory() ) {
290                                                    rtnVal = FileUtil.copyDirectry( file, newFile );
291                                            }
292                                    }
293                            }
294                    }
295                    else {
296                            String errMsg = "アクションが指定されてã�?�¾せん。アクション NULL エラー"
297                                                            + HybsSystem.CR
298                                                            + "  file=[" + file1 + "]" ;
299                            throw new HybsSystemException( errMsg );
300                    }
301    
302                    return rtnVal;
303            }
304    
305            /**
306             * 【TAG】アクション(canRead,canWrite,createNewFile,delete,exists,isDirectory,isFile,isHidden,mkdir,mkdirs)を指定しますã?
307             *
308             * @og.tag
309             * アクションは,HTMLから(get/post)æŒ?®šされますã?で,ACT_xxx で設定される
310             * フィールド定数値のã�?�¥れかをã?æŒ?®šできますã?
311             *
312             * canRead          読み込めるかどã�?�‹を判定ã?
313             * canWrite         変更できるかどã�?�‹判定ã?
314             * createNewFile    空の新しいファイルを不可åˆ?(atomic) に生æ?ã€?そã?ファイルがまã�?­˜在しなã�??合だã�?
315             * delete           ファイルまたã?ãƒ?‚£レクトリを削除ã€?
316             * renameTo         ファイルまたã?ãƒ?‚£レクトリ名を変更ã€?
317             * exists           ファイルが存在するかどã�?�‹判定ã?
318             * isDirectory      ファイルがディレクトリであるかどã�?�‹判定ã?
319             * isFile           ファイルが普通ã?ファイルかどã�?�‹判定ã?
320             * isHidden         ファイルが隠しファイルかどã�?�‹判定ã?
321             * mkdir            ãƒ?‚£レクトリを生成ã?
322             * mkdirs           ãƒ?‚£レクトリをè¤?•°生æ?ã€?
323             * read             ファイルを読み込んでjspWriterに出åŠ?
324             * existsLength     ファイルサイズが0Byte以上ã?ファイルが存在するかどã�?�‹判定ã?
325             * copy             ファイルまたã?ãƒ?‚£レクトリをコピã?ã€?
326             *
327             * @og.rev 3.0.0.0 (2002/12/25) ACTION_LIST のチェãƒ?‚¯を導å?
328             * @og.rev 3.5.6.2 (2004/07/05) æ–?­—å?の連結にStringBuilderを使用しますã?
329             *
330             * @param       cmd アクションæ–?­—å?
331             * @see         <a href="{&#064;docRoot}/constant-values.html#org.opengion.hayabusa.taglib.FileTag.ACT_canRead">アクション定数</a>
332             */
333            public void setAction( final String cmd ) {
334                    action = getRequestParameter( cmd );
335    
336                    if( ! check( action, ACTION_LIST ) ) {
337    
338                            StringBuilder errMsg = new StringBuilder( HybsSystem.BUFFER_MIDDLE );
339                            errMsg.append( "æŒ?®šã?アクションは実行できません。アクションエラー" );
340                            errMsg.append( HybsSystem.CR );
341                            errMsg.append( "action=[" ).append( action ).append( "] " );
342                            errMsg.append( HybsSystem.CR );
343    
344                            for( int i=0; i<ACTION_LIST.length; i++ ) {
345                                    errMsg.append( " | " );
346                                    errMsg.append( ACTION_LIST[i] );
347                            }
348                            errMsg.append( " | " );
349                            throw new HybsSystemException( errMsg.toString() );
350                    }
351            }
352    
353            /**
354             * 【TAG】操作するファイルのãƒ?‚£レクトリを指定しまã�?
355             *              (初期値:FILE_URL[={@og.value org.opengion.hayabusa.common.SystemData#FILE_URL}])ã€?
356             *
357             * @og.tag
358             * こã?属æ?でæŒ?®šされるãƒ?‚£レクトリのファイルを操作しますã?
359             * æŒ?®š方法ã?ã€??常の fileURL 属æ?と同様に、å?頭がã?'/' (UNIX) またã?ã€?¼’文字目がã?
360             * ":" (Windows)の場合ã?、指定ã?URLそã?ままのãƒ?‚£レクトリに、そã�?�§なã�??合ã?ã€?
361             * (初期値:シスãƒ?ƒ 定数のFILE_URL[={@og.value org.opengion.hayabusa.common.SystemData#FILE_URL}])ã€?
362             *
363             * @og.rev 4.0.0.0 (2005/01/31) urlAppend メソãƒ?ƒ‰の利用
364             * @og.rev 4.0.0.0 (2007/11/20) æŒ?®šされたãƒ?‚£レクトリ名ã?æœ?¾Œが"\"or"/"で終わってã�?�ªã�??合にã€?/"を付加するã€?
365             *
366             * @param       url ファイルURL
367             * @see         org.opengion.hayabusa.common.SystemData#FILE_URL
368             */
369            public void setFileURL( final String url ) {
370                    String furl = nval( getRequestParameter( url ),null );
371                    if( furl != null ) {
372                            char ch = furl.charAt( furl.length()-1 );
373                            if( ch != '/' && ch != '\\' ) { furl = furl + "/"; }
374                            fileURL = StringUtil.urlAppend( fileURL,furl );
375                    }
376            }
377    
378            /**
379             * 【TAG】基準となるファイル名をæŒ?®šしまã�?コマンドã?左辺のファイル名でã�?ã€?
380             *
381             * @og.tag
382             * コマンドã?左辺のファイル名ですã?
383             *
384             * @param       fname ファイル名ï¼?
385             */
386            public void setFile1( final String fname ) {
387                    file1 = nval( getRequestParameter( fname ),file1 );
388            }
389    
390            /**
391             * 【TAG】å?ç�?µ�果となるファイル名をæŒ?®šしまã�?コマンドã?右辺のファイル名でã�?ã€?
392             *
393             * @og.tag
394             * コマンドã?右辺のファイル名ですã?
395             *
396             * @param       fname ファイル名ï¼?
397             */
398            public void setFile2( final String fname ) {
399                    file2 = nval( getRequestParameter( fname ),file2 );
400            }
401    
402            /**
403             * 【TAG】判定結果を反転させるかどã�?�‹[true/false]を指定しまã�?初期値:false)ã€?
404             *
405             * @og.tag
406             * 通常の判定結果において、不æ?ç«?false)の場合に、BODY を実行しますã?
407             * 通常の処ç�?µ�果の正反対の処ç�?‚’行いますã?
408             * 初期値はã€??常 (true 以å¤?ですã?
409             *
410             * @og.rev 3.8.5.2 (2006/05/31) 新規追åŠ?
411             *
412             * @param   flag  [true:反転する/それ以å¤?通常]
413             */
414            public void setNotEquals( final String flag ) {
415                    notEquals = nval( getRequestParameter( flag ),notEquals );
416            }
417    
418            /**
419             * 【TAG】エラーæ™?ODYをå?ç�?¾Œに停止するかどã�?�‹[true/false]を指定しまã�?初期値:true)ã€?
420             *
421             * @og.tag
422             * 処ç�?µ�果などに応じて、以下ã?処ç�?‚’停止したã�??合に、使用しますã?
423             * 通常は、条件を判定後ã?false の場合に、BODY部をå?åŠ?処ç�?した後にã€?
424             * 処ç�?‚’停止しますã?(useStop="true")
425             * false を指定すると、判定結果に無関係に、以下ã?処ç�?‚’実行しますã?
426             * 処ç�??継続したいがã?警告表示する場合に、useStop="false" を指定しますã?
427             * 初期値は、停止する ("true")ですã?
428             *
429             * @og.rev 3.8.5.2 (2006/05/31) 新規追åŠ?
430             *
431             * @param   flag  [true:判定すã‚?それ以å¤?しない]
432             */
433            public void setUseStop( final String flag ) {
434                    useStop = nval( getRequestParameter( flag ),useStop );
435            }
436    
437            /**
438             * 【TAG】ファイルを読み込ã‚?action="READ")際ã?エンコードをæŒ?®šしまã�?初期値:OS依存文字コーãƒ?ã€?
439             *
440             * @og.tag
441             * ファイルを読み込ã‚?action="READ")際ã?エンコードをæŒ?®šしますã?
442             * action="READ"以外å?合には、この属æ?値は利用されませんã€?
443             * æŒ?®šしなã�??合ã?、OS依存文字コードで読み込まれますã?
444             *
445             * @og.rev 5.1.9.0 (2010/08/01) 新規作æ?
446             *
447             * @param   enc ファイル読み込みのエンコーãƒ?
448             */
449            public void setEncode( final String enc ) {
450                    encode = nval( getRequestParameter( enc ),encode );
451            }
452    
453            /**
454             * こã?オブジェクトã?æ–?­—å?表現を返しますã?
455             * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
456             *
457             * @return こã?クラスのæ–?­—å?表現
458             */
459            @Override
460            public String toString() {
461                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
462                                    .println( "VERSION"             ,VERSION        )
463                                    .println( "fileURL"             ,fileURL        )
464                                    .println( "file1"               ,file1          )
465                                    .println( "file2"               ,file2          )
466                                    .println( "action"              ,action         )
467                                    .println( "rtnCode"             ,rtnCode        )
468                                    .println( "notEquals"   ,notEquals      )
469                                    .println( "useStop"             ,useStop        )
470                                    .println( "Other..."    ,getAttributes().getAttribute() )
471                                    .fixForm().toString() ;
472            }
473    }