KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > core > config > ConfigUtils


1 /**
2 * Copyright (c) 2004-2005 jManage.org
3 *
4 * This is a free software; you can redistribute it and/or
5 * modify it under the terms of the license at
6 * http://www.jmanage.org.
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */

14 package org.jmanage.core.config;
15
16 import java.net.URL JavaDoc;
17 import java.net.MalformedURLException JavaDoc;
18 import java.io.File JavaDoc;
19
20 /**
21  *
22  * <p>
23  * Date: Sep 25, 2005
24  * @author Rakesh Kalra
25  */

26 public class ConfigUtils {
27
28     public static URL JavaDoc[] getClassPath(File JavaDoc dir){
29         assert dir.isDirectory();
30         try {
31             File JavaDoc[] files = dir.listFiles();
32             URL JavaDoc[] urls = new URL JavaDoc[files.length];
33             for(int i=0; i<files.length; i++){
34                 urls[i] = files[i].toURL();
35             }
36             return urls;
37         } catch (MalformedURLException JavaDoc e) {
38             throw new RuntimeException JavaDoc(e);
39         }
40     }
41 }
42
Popular Tags