Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2010 JBoss Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.jbpm.process.workitem.ftp;

 public class FTPUploadWorkItemHandler implements WorkItemHandler {
     private String user;
     private String password;
     private String server;
     private String filePath;
     private int port;
     private FTPClient client
     private Connection connection;
     private boolean result = false;
 	public void setConnection(String hostString portString userNameString password) {
 		 = new Connection();
     public void executeWorkItem(WorkItem workItemWorkItemManager manager) {
         this. = (StringworkItem.getParameter("User");
         this. = (StringworkItem.getParameter("Password");
         this. = (StringworkItem.getParameter("FilePath");
          = new FTPClient();
         try {
             if( != null){
                 .connect(.getHost(), Integer.parseInt(.getPort()));
                 int reply = .getReplyCode();
                 if (FTPReply.isPositiveCompletion(reply))
                         InputStream input;
                         input = new FileInputStream();
         } catch (SocketException ex) {
         } catch (IOException ex) {
         manager.completeWorkItem(workItem.getId(), null);
    public void abortWorkItem(WorkItem workItemWorkItemManager manager) {
        throw new UnsupportedOperationException("Not supported yet.");


the result
    public boolean isResult() {
        return ;


result the result to set
    public void setResult(boolean result) {
        this. = result;
New to GrepCode? Check out our FAQ X