docroot/WEB-INF/src/it/infn/ct/g_hmmer_portlet.java
void processInputFile(FileItem item,AppInput appInput) {            
        // Determin the filename
        String fileName = item.getName();
        if(!fileName.equals("")) {
            // Determine the fieldName
            String fieldName = item.getFieldName();
            
            // Create a filename for the uploaded file
            String theNewFileName = "/tmp/"
                                   +appInput.timestamp
                                   +"_"
                                   +appInput.username
                                   +"_"
                                   +fileName;        
            File uploadedFile = new File(theNewFileName);
            _log.info("Uploading file: '"+fileName+"' into '"+theNewFileName+"'");
            try {
                item.write(uploadedFile);
            } 
            catch (Exception e) {
                _log.error("Caught exception while uploading file: 'file_inputFile'");
            }
            // File content has to be inserted into a String variables:
            //   inputFileName -> inputFileText
            try {
                if(fieldName.equals("file_inputFile"))
                 appInput.inputFileText=updateString(theNewFileName);
                 // Other params can be added as below ...
                 //else if(fieldName.equals("..."))
                 //   ...=updateString(theNewFileName);
            else { // Never happens
                 }    
            }
            catch (Exception e) {
                _log.error("Caught exception while processing strings: '"+e.toString()+"'");
            }
        } // if
    }
/**
     * This method is called when the user specifies a input file to upload
     * The file will be saved first into /tmp directory and then its content
     * stored into the corresponding String variable
     * Before to submit the job the String value will be stored in the 
     * proper job inputSandbox file
     * 
     * @param item
     * @param appInput  AppInput instance storing the jobSubmission data
     */
This method is called when the user specifies a input file to upload
The file will be saved first into /tmp directory and then its content
stored into the corresponding String variable
Before to submit the job the String value will be stored in the
proper job inputSandbox file

@param item
@param appInput  AppInput instance storing the jobSubmission data
This method is called when the user specifies a input file to upload The file will be saved first into / tmp directory and then its content stored into the corresponding String variable Before to submit the job the String value will be stored in the proper job inputSandbox file @param item @param appInput AppInput instance storing the jobSubmission data
void processInputFile(FileItem item,AppInput appInput) {            
        String fileName = item.getName();
        if(!fileName.equals("")) {
            String fieldName = item.getFieldName();
            String theNewFileName = "/tmp/"
                                   +appInput.timestamp
                                   +"_"
                                   +appInput.username
                                   +"_"
                                   +fileName;        
            File uploadedFile = new File(theNewFileName);
            _log.info("Uploading file: '"+fileName+"' into '"+theNewFileName+"'");
            try {
                item.write(uploadedFile);
            } 
            catch (Exception e) {
                _log.error("Caught exception while uploading file: 'file_inputFile'");
            }
            try {
                if(fieldName.equals("file_inputFile"))
                 appInput.inputFileText=updateString(theNewFileName);
            else { 
                 }    
            }
            catch (Exception e) {
                _log.error("Caught exception while processing strings: '"+e.toString()+"'");
            }
        } 
    }
void processInputFile ( FileItem item , AppInput appInput ) { String fileName = item . getName ( ) ; if ( ! fileName . equals ( "" ) ) { String fieldName = item . getFieldName ( ) ; String theNewFileName = "/tmp/" + appInput . timestamp + "_" + appInput . username + "_" + fileName ; File uploadedFile = new File ( theNewFileName ) ; _log . info ( "Uploading file: '" + fileName + "' into '" + theNewFileName + "'" ) ; try { item . write ( uploadedFile ) ; } catch ( Exception e ) { _log . error ( "Caught exception while uploading file: 'file_inputFile'" ) ; } try { if ( fieldName . equals ( "file_inputFile" ) ) appInput . inputFileText = updateString ( theNewFileName ) ; else { } } catch ( Exception e ) { _log . error ( "Caught exception while processing strings: '" + e . toString ( ) + "'" ) ; } } }
This method is called when the user specifies a input file to upload
 The file will be saved first into /tmp directory and then its content
 stored into the corresponding String variable
 Before to submit the job the String value will be stored in the
 proper job inputSandbox file
This method is called when the user specifies a input file to upload The file will be saved first into / tmp directory and then its content stored into the corresponding String variable Before to submit the job the String value will be stored in the proper job inputSandbox file
// Determin the filename // Determine the fieldName // Create a filename for the uploaded file // File content has to be inserted into a String variables: //   inputFileName -> inputFileText // Other params can be added as below ... //else if(fieldName.equals("...")) //   ...=updateString(theNewFileName); // Never happens // if