incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: rev 6172 - incubator/depot/trunk/ruper/src/java/core/org/apache/ruper
Date Thu, 15 Jan 2004 21:28:06 GMT
Author: mmay
Date: Thu Jan 15 13:28:05 2004
New Revision: 6172

Modified:
   incubator/depot/trunk/ruper/src/java/core/org/apache/ruper/FileAssistant.java
Log:
Code Guideline suggestions

Modified: incubator/depot/trunk/ruper/src/java/core/org/apache/ruper/FileAssistant.java
==============================================================================
--- incubator/depot/trunk/ruper/src/java/core/org/apache/ruper/FileAssistant.java	(original)
+++ incubator/depot/trunk/ruper/src/java/core/org/apache/ruper/FileAssistant.java	Thu Jan
15 13:28:05 2004
@@ -55,14 +55,8 @@
  * originally written at the National Center for Supercomputing Applications,
  * University of Illinois, Urbana-Champaign.
  */
-
 package org.apache.ruper;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import org.apache.ruper.files.DefaultResourceFilenameAnalyzer;
 import org.apache.ruper.files.IResourceFilenameAnalyzer;
 import org.apache.ruper.resource.Resource;
@@ -71,67 +65,105 @@
 import org.apache.ruper.util.net.VirtualResourceLocator;
 import org.apache.version.util.SystemUtils;
 
+import java.io.File;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+
 /**
+ * TODO write Documentation
+ *
+ * @version $Rev$
+ * 
  * @author arb_jack
+ * @author $LastChangedBy$
  */
 public class FileAssistant /* implements Referenceable */ {
-	private File m_baseFile = null;
-	private IResourceFilenameAnalyzer m_analyzer = null;
+    private File baseFile = null;
+    private IResourceFilenameAnalyzer analyzer = null;
 
-	/**
-	 * 
-	 */
-	public FileAssistant() {
-		this(SystemUtils.getCWD());
-	}
-
-	/**
-	 * 
-	 */
-	public FileAssistant(File baseFile) {
-		m_analyzer =
-			new DefaultResourceFilenameAnalyzer(
-				new VirtualResourceLocator(ResolvedFile.resolve(baseFile)));
-
-		m_baseFile = baseFile;
-	}
-
-	/**
-	 * 
-	 * Resolve a file (i.e. get absolute path) within the "context" 
-	 * of this API's baseFile (i.e. CWD or whatever)
-	 * 
-	 * @param file
-	 * @return
-	 */
-	public ResolvedFile resolveFile(Object file) {
-		return ResolvedFile.resolve(m_baseFile, file);
-	}
-
-	public List getResourceSpecifiersForFiles(List files)
-		throws RuperException {
-		List specifiers = new ArrayList();
-
-		for (Iterator i = files.iterator(); i.hasNext();) {
-			specifiers.add(getResourceSpecifierForFile(((File) i.next())));
-		}
-
-		return specifiers;
-	}
-
-	public ResourceSpecifier getResourceSpecifierForFile(File file)
-		throws RuperException {
-		Resource resource = m_analyzer.determineResource(file);
-		return resource.getSpecifier();
-	}
-
-	public static void main(String args[]) throws Exception {
-		String file = "test.jar";
-		if (args.length > 0)
-			file = args[0];
-
-		FileAssistant fa = new FileAssistant(SystemUtils.getCWD());
-
-		fa.getResourceSpecifierForFile(new File(file));
-	}
-}
+    /**
+     * Constructor  
+     * constructs a new FileAssistant with the default baseFile (CurrentWorkingDirectory)
+     */
+    public FileAssistant() {
+        this(SystemUtils.getCWD());
+    }
+
+    /**
+     *
+     */
+    public FileAssistant(File baseFile) {
+        this.baseFile = baseFile;
+
+        this.analyzer = new DefaultResourceFilenameAnalyzer(new VirtualResourceLocator(ResolvedFile.resolve(this.baseFile)));
+    }
+
+    /**
+     * Resolve a file (i.e. get absolute path) within the "context"  of this API's baseFile
(i.e. CWD or whatever)
+     *
+     * @param file
+     *
+     * @return
+     */
+    public ResolvedFile resolveFile(Object file) {
+        return ResolvedFile.resolve(baseFile, file);
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param files TODO	
+     *
+     * @return TODO
+     *
+     * @throws RuperException TODO
+     */
+    public List getResourceSpecifiersForFiles(List files)
+                                       throws RuperException {
+        List specifiers = new ArrayList();
+
+        for (Iterator i = files.iterator(); i.hasNext();) {
+            specifiers.add(getResourceSpecifierForFile(((File) i.next())));
+        }
+
+        return specifiers;
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param file TODO	
+     *
+     * @return TODO
+     *
+     * @throws RuperException TODO
+     */
+    public ResourceSpecifier getResourceSpecifierForFile(File file)
+                                                  throws RuperException {
+        Resource resource = analyzer.determineResource(file);
+
+        return resource.getSpecifier();
+    }
+
+    /**
+     * TODO Add JavaDoc
+     *
+     * @param args TODO	
+     *
+     * @throws Exception TODO
+     */
+    public static void main(String[] args) throws Exception {
+        String file = "test.jar";
+
+        if (args.length > 0) {
+            file = args[0];
+        }
+
+        FileAssistant fa = new FileAssistant(SystemUtils.getCWD());
+
+        fa.getResourceSpecifierForFile(new File(file));
+    }
+}
\ No newline at end of file

Mime
View raw message