[Webfunds-commits] java/webfunds/ricardian DirContractStore.java
Jeroen C. van Gelderen
gelderen@cypherpunks.ai
Tue, 20 Feb 2001 17:55:47 -0400 (AST)
gelderen 01/02/20 17:55:47
Modified: webfunds/ricardian DirContractStore.java
Log:
- Mark mv(File, File) function 'private static' as it is not used outside
this class. If it gets used outside this class in the future it needs
to move under webfunds.util.FileUtils or so.
- Capitalize constant name.
- Clean up formatting a bit.
Revision Changes Path
1.18 +18 -20 java/webfunds/ricardian/DirContractStore.java
Index: DirContractStore.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/ricardian/DirContractStore.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DirContractStore.java 2000/09/17 19:40:53 1.17
+++ DirContractStore.java 2001/02/20 21:55:47 1.18
@@ -1,5 +1,5 @@
/*
- * $Id: DirContractStore.java,v 1.17 2000/09/17 19:40:53 iang Exp $
+ * $Id: DirContractStore.java,v 1.18 2001/02/20 21:55:47 gelderen Exp $
*
* Copyright (c) Systemics Ltd 1995-1999 on behalf of
* the WebFunds Development Team. All Rights Reserved.
@@ -18,6 +18,7 @@
import webfunds.sox.*;
import webfunds.utils.Debug;
+
/**
* Read in a directory of contracts and provide access to them.
* Derived from client.DirContractStore and InfoBag.pm.
@@ -29,23 +30,28 @@
/**
* All the contracts, indexed by ItemId.
- * ItemId ==> Contract
+ * ItemId ==> Contract
*/
protected Hashtable contracts;
+
+
/**
* All the names, pointing to ItemIds of contracts that answer
* to the name.
- * String ==> ItemId[]
+ * String ==> ItemId[]
*/
protected Hashtable allNames;
-
protected File dir;
+
+
/**
- * The directory of contracts.
+ * Get the directory of contracts.
*/
public File getDirectory() { return dir ; }
+
+
/**
* Unknown?
*/
@@ -266,7 +272,7 @@
}
}
- public void mv(File src, File dir)
+ private static void mv(File src, File dir)
{
String name = src.getName();
File tgt = new File(dir, name);
@@ -572,10 +578,6 @@
}
-
-
-
-
public String toString()
{
String retval = "DirContractStore: " +
@@ -585,7 +587,11 @@
return retval;
}
- static final String usage =
+
+// Tests
+//............................................................................
+
+ private static final String USAGE =
"Test Usage: DirContractStore directory [toy_contract...]";
public static void main(String[] arg)
@@ -593,7 +599,7 @@
{
if (arg.length == 0)
{
- System.err.println(usage);
+ System.err.println(USAGE);
System.exit(1);
}
@@ -669,11 +675,3 @@
}
}
}
-
-// new FilenameFilter()
-// {
-// public boolean accept(File dir, String name)
-// {
-// return (name.endsWith(".asc"));
-// }
-// });