KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > backup > component > model > ImportData


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlets.backup.component.model;
6
7 import java.util.* ;
8 import java.util.jar.*;
9 import java.io.File JavaDoc ;
10 /**
11  * Jun 2, 2004
12  * @author: Tuan Nguyen
13  * @email: tuan08@users.sourceforge.net
14  * @version: $ID$
15  **/

16 public class ImportData {
17     private String JavaDoc name_ ;
18     private Date createdDate_ ;
19   private Date modifiedDate_ ;
20     private String JavaDoc resourceURL_ ;
21     private List dataEntries_ ;
22     private JarFile jarFile_ ;
23     
24     public ImportData(File JavaDoc file) {
25         name_ = file.getName() ;
26         Date date = new Date(file.lastModified()) ;
27     createdDate_ = date ;
28     modifiedDate_ = date ;
29         resourceURL_ = file.getAbsolutePath() ;
30     }
31     
32     public String JavaDoc getName() { return name_ ; }
33     public Date getCreatedDate() { return createdDate_ ; }
34     public Date getModifiedDate() { return modifiedDate_ ; }
35     
36     public String JavaDoc getResourceURL() { return resourceURL_ ; }
37     
38     public List getDataEntries() {
39         if(dataEntries_ == null) {
40             
41         }
42         return dataEntries_ ;
43     }
44     
45     public Enumeration getEntries() {
46         try {
47             JarFile jar = getJarFile() ;
48             return jar.entries() ;
49         } catch (Exception JavaDoc ex) {
50             ex.printStackTrace() ;
51         }
52         return null ;
53     }
54     
55     private JarFile getJarFile() throws Exception JavaDoc {
56         if(jarFile_ == null) {
57             jarFile_ = new JarFile(new File JavaDoc(resourceURL_)) ;
58         }
59         return jarFile_ ;
60     }
61 }
Popular Tags