src/Java.st
branchjk_new_structure
changeset 1133 f3f56615d5b2
parent 1130 9e6c3f1aadd4
child 1152 040cba55a7d2
--- a/src/Java.st	Thu Nov 17 23:31:33 2011 +0000
+++ b/src/Java.st	Thu Nov 17 23:38:07 2011 +0000
@@ -218,25 +218,30 @@
 
 !Java class methodsFor:'accessing paths'!
 
-addToClassPath:aPath
+addToClassPath:pathOrCollection
 
     | path |
-    path := aPath asFilename.
+    (pathOrCollection isSequenceable 
+        and:[pathOrCollection isCharacters not]) ifTrue:[
+        pathOrCollection do:[:each|self addToClassPath: each].
+        ^self.
+    ].
+    path := pathOrCollection asFilename.
 
-    (aPath asString includes: $*) ifTrue:[
+    (pathOrCollection asString includes: $*) ifTrue:[
         self addToClassPathFilesMatching: path baseName
              in: path directoryName.
     ] ifFalse:[
-        (ClassPath includes:aPath asString) ifFalse:[
-            ClassPath add:aPath asString.
-            self addToClassPathInRuntime:aPath.
+        (ClassPath includes:pathOrCollection asString) ifFalse:[
+            ClassPath add:pathOrCollection asString.
+            self addToClassPathInRuntime:pathOrCollection.
             FailedToLoadClasses := nil
         ]
     ]
 
     "Created: / 01-08-1997 / 21:10:07 / cg"
     "Modified: / 17-09-1998 / 20:43:55 / cg"
-    "Modified: / 07-08-2011 / 14:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-11-2011 / 23:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addToClassPathFilesMatching: pattern in: path
@@ -276,14 +281,21 @@
     "Created: / 07-08-2011 / 14:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-addToSourcePath:aPath
+addToSourcePath:pathOrCollection
+
+    (pathOrCollection isSequenceable 
+        and:[pathOrCollection isCharacters not]) ifTrue:[
+        pathOrCollection do:[:each|self addToSourcePath: each].
+        ^self.
+    ].
+
     SourceDirectories ifNil:[SourceDirectories := OrderedCollection new].
-    (SourceDirectories includes:aPath) ifFalse:[
-        SourceDirectories add:aPath
+    (SourceDirectories includes:pathOrCollection) ifFalse:[
+        SourceDirectories add:pathOrCollection
     ]
 
     "Created: / 02-08-1997 / 14:12:31 / cg"
-    "Modified: / 06-02-2011 / 22:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-11-2011 / 23:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cacheDirectory