railo.runtime.tag
Class FileTag

java.lang.Object
  extended by railo.runtime.ext.tag.TagImpl
      extended by railo.runtime.tag.FileTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.Tag

public final class FileTag
extends TagImpl

Handles all interactions with files. The attributes you use with cffile depend on the value of the action attribute. For example, if the action = "write", use the attributes associated with writing a text file.


Field Summary
static int NAMECONFLICT_ERROR
           
static int NAMECONFLICT_MAKEUNIQUE
           
static int NAMECONFLICT_OVERWRITE
           
static int NAMECONFLICT_SKIP
           
static int NAMECONFLICT_UNDEFINED
           
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FileTag()
           
 
Method Summary
static void actionCopy(PageContext pageContext, SecurityManager securityManager, Resource source, String strDestination, int nameconflict, String serverPassword, Object acl, int mode, String attributes)
          copy source file to destination file or path
static void actionMove(PageContext pageContext, SecurityManager securityManager, Resource source, String strDestination, int nameconflict, String serverPassword, Object acl, int mode, String attributes)
          move source file to destination path or file
 void actionUpload()
          read source file
static Struct actionUpload(PageContext pageContext, SecurityManager securityManager, String filefield, String strDestination, int nameconflict, String accept, int mode, String attributes, Object acl, String serverPassword)
           
 void actionUploadAll()
           
static Array actionUploadAll(PageContext pageContext, SecurityManager securityManager, String strDestination, int nameconflict, String accept, int mode, String attributes, Object acl, String serverPassword)
           
 int doEndTag()
           
 int doStartTag()
           
 void release()
           
 void setAccept(String accept)
          set the value accept Limits the MIME types to accept.
 void setAcl(Object acl)
           
 void setAcl(String acl)
          set the value acl used only for s3 resources, for all others ignored
 void setAction(String action)
          set the value action Type of file manipulation that the tag performs.
 void setAddnewline(boolean addnewline)
          set the value addnewline Yes: appends newline character to text written to file
 void setAttributes(String attributes)
          set the value attributes One attribute (Windows) or a comma-delimited list of attributes (other platforms) to set on the file.
 void setCharset(String charset)
          set the value charset Character set name for the file contents.
 void setDestination(String destination)
          set the value destination Absolute pathname of directory or file on web server.
 void setFile(String file)
          set the value file Absolute pathname of file on web server.
 void setFilefield(String filefield)
          set the value filefield Name of form field used to select the file.
 void setFixnewline(boolean fixnewline)
           
 void setMode(String mode)
          set the value mode Applies only to Solaris and HP-UX.
 void setNameconflict(String nameconflict)
          set the value nameconflict Action to take if filename is the same as that of a file in the directory.
 void setOutput(Object output)
          set the value output Content of the file to be created.
 void setResult(String result)
           
 void setServerpassword(String serverPassword)
           
 void setSource(String source)
          set the value source Absolute pathname of file on web server.
 void setStoreacl(Object acl)
           
 void setVariable(String variable)
          set the value variable Name of variable to contain contents of text file.
static int toMode(String mode)
           
static int toNameconflict(String nameconflict)
           
 
Methods inherited from class railo.runtime.ext.tag.TagImpl
getParent, required, required, required, required, setPageContext, setPageContext, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMECONFLICT_UNDEFINED

public static final int NAMECONFLICT_UNDEFINED
See Also:
Constant Field Values

NAMECONFLICT_ERROR

public static final int NAMECONFLICT_ERROR
See Also:
Constant Field Values

NAMECONFLICT_SKIP

public static final int NAMECONFLICT_SKIP
See Also:
Constant Field Values

NAMECONFLICT_OVERWRITE

public static final int NAMECONFLICT_OVERWRITE
See Also:
Constant Field Values

NAMECONFLICT_MAKEUNIQUE

public static final int NAMECONFLICT_MAKEUNIQUE
See Also:
Constant Field Values
Constructor Detail

FileTag

public FileTag()
Method Detail

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class TagImpl
See Also:
Tag.release()

setAction

public void setAction(String action)
set the value action Type of file manipulation that the tag performs.

Parameters:
action - value to set

setDestination

public void setDestination(String destination)
set the value destination Absolute pathname of directory or file on web server.

Parameters:
destination - value to set

setOutput

public void setOutput(Object output)
set the value output Content of the file to be created.

Parameters:
output - value to set

setFile

public void setFile(String file)
set the value file Absolute pathname of file on web server.

Parameters:
file - value to set

setMode

public void setMode(String mode)
             throws PageException
set the value mode Applies only to Solaris and HP-UX. Permissions. Octal values of UNIX chmod command. Assigned to owner, group, and other, respectively.

Parameters:
mode - value to set
Throws:
PageException

toMode

public static int toMode(String mode)
                  throws PageException
Throws:
PageException

setVariable

public void setVariable(String variable)
set the value variable Name of variable to contain contents of text file.

Parameters:
variable - value to set

setFilefield

public void setFilefield(String filefield)
set the value filefield Name of form field used to select the file.

Parameters:
filefield - value to set

setCharset

public void setCharset(String charset)
set the value charset Character set name for the file contents.

Parameters:
charset - value to set

setAcl

public void setAcl(String acl)
            throws ApplicationException
set the value acl used only for s3 resources, for all others ignored

Parameters:
charset - value to set
Throws:
ApplicationException

setAcl

public void setAcl(Object acl)
            throws ApplicationException
Throws:
ApplicationException

setStoreacl

public void setStoreacl(Object acl)
                 throws ApplicationException
Throws:
ApplicationException

setServerpassword

public void setServerpassword(String serverPassword)

setAddnewline

public void setAddnewline(boolean addnewline)
set the value addnewline Yes: appends newline character to text written to file

Parameters:
addnewline - value to set

setAttributes

public void setAttributes(String attributes)
set the value attributes One attribute (Windows) or a comma-delimited list of attributes (other platforms) to set on the file. If omitted, the file's attributes are maintained.

Parameters:
attributes - value to set

setSource

public void setSource(String source)
set the value source Absolute pathname of file on web server. On Windows, use backward slashes; on UNIX, use forward slashes.

Parameters:
source - value to set

setNameconflict

public void setNameconflict(String nameconflict)
                     throws ApplicationException
set the value nameconflict Action to take if filename is the same as that of a file in the directory.

Parameters:
nameconflict - value to set
Throws:
ApplicationException

toNameconflict

public static int toNameconflict(String nameconflict)
                          throws ApplicationException
Throws:
ApplicationException

setAccept

public void setAccept(String accept)
set the value accept Limits the MIME types to accept. Comma-delimited list. For example, to permit JPG and Microsoft Word file uploads: accept = "image/jpg, application/msword" The browser uses file extension to determine file type.

Parameters:
accept - value to set

setResult

public void setResult(String result)
Parameters:
result - The result to set.

doStartTag

public int doStartTag()
               throws PageException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class TagImpl
Throws:
PageException
See Also:
Tag.doStartTag()

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class TagImpl
See Also:
Tag.doEndTag()

actionMove

public static void actionMove(PageContext pageContext,
                              SecurityManager securityManager,
                              Resource source,
                              String strDestination,
                              int nameconflict,
                              String serverPassword,
                              Object acl,
                              int mode,
                              String attributes)
                       throws PageException
move source file to destination path or file

Throws:
PageException

actionCopy

public static void actionCopy(PageContext pageContext,
                              SecurityManager securityManager,
                              Resource source,
                              String strDestination,
                              int nameconflict,
                              String serverPassword,
                              Object acl,
                              int mode,
                              String attributes)
                       throws PageException
copy source file to destination file or path

Throws:
PageException

actionUpload

public void actionUpload()
                  throws PageException
read source file

Throws:
PageException

actionUpload

public static Struct actionUpload(PageContext pageContext,
                                  SecurityManager securityManager,
                                  String filefield,
                                  String strDestination,
                                  int nameconflict,
                                  String accept,
                                  int mode,
                                  String attributes,
                                  Object acl,
                                  String serverPassword)
                           throws PageException
Throws:
PageException

actionUploadAll

public void actionUploadAll()
                     throws PageException
Throws:
PageException

actionUploadAll

public static Array actionUploadAll(PageContext pageContext,
                                    SecurityManager securityManager,
                                    String strDestination,
                                    int nameconflict,
                                    String accept,
                                    int mode,
                                    String attributes,
                                    Object acl,
                                    String serverPassword)
                             throws PageException
Throws:
PageException

setFixnewline

public void setFixnewline(boolean fixnewline)
Parameters:
fixnewline - the fixnewline to set


Copyright © 2012 Railo