svn commit: r635321 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r635321 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

jaz-3
Author: jaz
Date: Sun Mar  9 11:31:16 2008
New Revision: 635321

URL: http://svn.apache.org/viewvc?rev=635321&view=rev
Log:
changed method getDataResourceContentUploadPath() to also accept the parameters to override the values found in the properties file. This will allow better re-use of this method.

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=635321&r1=635320&r2=635321&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Sun Mar  9 11:31:16 2008
@@ -481,6 +481,17 @@
         if (maxFiles < 1) {
             maxFiles = 250;
         }
+
+        return getDataResourceContentUploadPath(initialPath, maxFiles);
+    }
+
+    /**
+     * Handles creating sub-directories for file storage; using a max number of files per directory
+     * @param initialPath the top level location where all files should be stored
+     * @param maxFiles the max number of files to place in a directory
+     * @return the absolute path to the directory where the file should be placed
+     */
+    public static String getDataResourceContentUploadPath(String initialPath, double maxFiles) {
         String ofbizHome = System.getProperty("ofbiz.home");
 
         if (!initialPath.startsWith("/")) {