commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r225683 - in /jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline: driver/SingleThreadStageDriver.java stage/FileFinderStage.java stage/FtpFileDownloadStage.java stage/HttpFileDownloadStage.java stage/LogStage.java
Date Thu, 28 Jul 2005 04:19:27 GMT
Author: skitching
Date: Wed Jul 27 21:19:19 2005
New Revision: 225683

URL: http://svn.apache.org/viewcvs?rev=225683&view=rev
Log:
Assorted minor fixups; submitted by Kris Nuttycombe

Modified:
    jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/driver/SingleThreadStageDriver.java
    jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FileFinderStage.java
    jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FtpFileDownloadStage.java
    jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/HttpFileDownloadStage.java
    jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/LogStage.java

Modified: jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/driver/SingleThreadStageDriver.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/driver/SingleThreadStageDriver.java?rev=225683&r1=225682&r2=225683&view=diff
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/driver/SingleThreadStageDriver.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/driver/SingleThreadStageDriver.java
Wed Jul 27 21:19:19 2005
@@ -14,25 +14,24 @@
  * limitations under the License.
  */
 
-package org.apache.commons.pipeline.impl;
+package org.apache.commons.pipeline.driver;
 
-import org.apache.commons.pipeline.StageException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.pipeline.StageDriver;
 import org.apache.commons.pipeline.StageMonitor;
 import org.apache.commons.pipeline.Stage;
-import org.apache.log4j.Logger;
-import java.util.*;
+import org.apache.commons.pipeline.StageException;
 
 /**
  * This is a very simple implementation of a StageDriver which spawns
- * only a single thread to process a stage. A SingleThreadStageDriver
- * may not be used to manipulate more than a single stage.
- *
- * @author Kris Nuttycombe, National Geophysical Data Center
- * @version $Revision$
+ * only a single thread to process a stage. 
  */
-public class SingleThreadStageDriver implements StageDriver {
-    private Logger log = Logger.getLogger(this.getClass());
+public class SingleThreadStageDriver extends StageDriver {
+    private static final Log log = LogFactory.getLog(SingleThreadStageDriver.class);
     
     //wait timeout to ensure deadlock cannot occur on thread termination
     private long timeout = 500;

Modified: jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FileFinderStage.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FileFinderStage.java?rev=225683&r1=225682&r2=225683&view=diff
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FileFinderStage.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FileFinderStage.java
Wed Jul 27 21:19:19 2005
@@ -4,36 +4,34 @@
  * 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
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * 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. 
+ * limitations under the License.
  */
 
-package org.apache.commons.pipeline.impl;
+package org.apache.commons.pipeline.stage;
 
 import java.io.File;
 import java.util.regex.Pattern;
 import java.util.Queue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.pipeline.BaseStage;
-import org.apache.log4j.Logger;
 
 /**
- * This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} is used
- * to recursively find (non-directory) files that match the specified regex.
- *
- * File elements in the stage's queue will be recursively searched with the
- * resulting File objects placed on the subsequent stage's queue.
+ * <p>This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} is used
+ * to recursively find (non-directory) files that match the specified regex.</p>
  *
- * @author Kris Nuttycombe, National Geophysical Data Center
- * @version $Revision$
+ * <p>File elements in the stage's queue will be recursively searched with the
+ * resulting File objects placed on the subsequent stage's queue.</p>
  */
 public class FileFinderStage extends BaseStage {
-    private static final Logger log = Logger.getLogger(FileFinderStage.class);
+    private static final Log log = LogFactory.getLog(FileFinderStage.class);
     private String filePattern = ".*";
     Pattern pattern;
     

Modified: jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FtpFileDownloadStage.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FtpFileDownloadStage.java?rev=225683&r1=225682&r2=225683&view=diff
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FtpFileDownloadStage.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/FtpFileDownloadStage.java
Wed Jul 27 21:19:19 2005
@@ -4,40 +4,43 @@
  * 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
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * 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. 
+ * limitations under the License.
  */
 
-package org.apache.commons.pipeline.impl;
+package org.apache.commons.pipeline.stage;
 
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashSet;
 import java.util.regex.Pattern;
 import java.util.Queue;
+import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPFile;
 import org.apache.commons.net.ftp.FTPReply;
 import org.apache.commons.pipeline.BaseStage;
 import org.apache.commons.pipeline.StageException;
-import org.apache.log4j.Logger;
 
 /**
- * This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} provides the 
- * functionality needed to retrieve data from an FTP URL. Multipart responses 
- * are not yet supported.
- *
- * @author Kris Nuttycombe, National Geophysical Data Center
- * @version $Revision$
+ * <p>This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} provides the
+ * functionality needed to retrieve data from an FTP URL. Multipart responses
+ * are not yet supported.</p>
  */
 public class FtpFileDownloadStage extends BaseStage {
-    private static Logger log = Logger.getLogger(FtpFileDownloadStage.class);
+    private static final Log log = LogFactory.getLog(FtpFileDownloadStage.class);
     
     private String workDir = "/tmp";
     private File fworkDir;

Modified: jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/HttpFileDownloadStage.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/HttpFileDownloadStage.java?rev=225683&r1=225682&r2=225683&view=diff
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/HttpFileDownloadStage.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/HttpFileDownloadStage.java
Wed Jul 27 21:19:19 2005
@@ -4,9 +4,9 @@
  * 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
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * 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.
@@ -14,22 +14,29 @@
  * limitations under the License. 
  */
 
-package org.apache.commons.pipeline.impl;
+package org.apache.commons.pipeline.stage;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Queue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.pipeline.StageException;
 import org.apache.commons.pipeline.BaseStage;
-import org.apache.log4j.Logger;
 
 
 /**
- * This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} provides the functionality

+ * This {@link org.apache.commons.pipeline.Pipeline$Stage Stage} provides the functionality
  * needed to retrieve data from an HTTP URL. Multipart responses are not yet supported.
  *
  * @author Kris Nuttycombe, National Geophysical Data Center
@@ -37,14 +44,15 @@
  */
 public class HttpFileDownloadStage extends BaseStage {
     private static final int BUFFER_SIZE = 10000;
-    private static Logger log = Logger.getLogger(HttpFileDownloadStage.class);
-    private String workDir = "/tmp";
+    private String workDir = null;
+    private static Log log = LogFactory.getLog(HttpFileDownloadStage.class);
     private File fworkDir;
     
     public HttpFileDownloadStage() { }
     
     /**
      * Creates a new HttpFileDownloadStage with the specified work directory.
+     * @deprecated Let File.createTempFile take care of the working directory issue.
      */
     public HttpFileDownloadStage(String workDir) {
         this.workDir = workDir;

Modified: jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/LogStage.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/LogStage.java?rev=225683&r1=225682&r2=225683&view=diff
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/LogStage.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/java/org/apache/commons/pipeline/stage/LogStage.java
Wed Jul 27 21:19:19 2005
@@ -14,22 +14,22 @@
  * limitations under the License. 
  */
 
-package org.apache.commons.pipeline.impl;
+package org.apache.commons.pipeline.stage;
 
 import org.apache.commons.pipeline.StageException;
 import org.apache.commons.pipeline.BaseStage;
-import org.apache.log4j.Logger;
 import java.util.Queue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 
 /**
- * A do-nothing implementation of Stage with Log4j logging. Useful for debugging purposes.
- *
- * @author Kris Nuttycombe, National Geophysical Data Center
- * @version $Revision$
+ * A do-nothing implementation of Stage that simply logs the state of processing. 
+ * and each object seen by its {@link #process(Object)} method.
+ * Useful for debugging purposes. 
  */
 public class LogStage extends BaseStage {
-    private Logger log = Logger.getLogger(this.getClass());
+    private Log log = LogFactory.getLog(this.getClass());
     
     /**
      * Creates a new LogStage.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message