View Javadoc
1   /*
2    * Copyright 2009 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.sys.batch;
17  
18  import java.io.File;
19  import java.util.Date;
20  import java.util.LinkedHashMap;
21  
22  import org.kuali.rice.krad.bo.TransientBusinessObjectBase;
23  
24  public class BatchFile extends TransientBusinessObjectBase {
25      private File file;
26      
27      public BatchFile() {
28      }
29  
30      public String getPath() {
31          return BatchFileUtils.pathRelativeToRootDirectory(file.getAbsoluteFile().getParentFile().getAbsolutePath());
32      }
33      
34      public String getFileName() {
35          return file.getName();
36      }
37      
38      public Date getLastModifiedDate() {
39          return new Date(file.lastModified());
40      }
41      
42      public long getFileSize() {
43          return file.length();
44      }
45      
46      
47      protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
48          return null;
49      }
50  
51      // purposely not creating a getter method, to prevent the file object from being unintentionally accessed via form parameters
52      public File retrieveFile() {
53          return file;
54      }
55      
56      public void setFile(File file) {
57          this.file = file;
58      }
59  }