]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDriver.java
Remove unused method in SLC Agent interface
[gpl/argeo-slc.git] / runtime / org.argeo.slc.server / src / main / java / org / argeo / slc / web / ajaxplorer / file / FileDriver.java
1 package org.argeo.slc.web.ajaxplorer.file;
2
3 import java.io.File;
4
5 import org.argeo.slc.web.ajaxplorer.SimpleAjxpDriver;
6
7 public class FileDriver extends SimpleAjxpDriver{
8 private String basePath;
9 private String encoding = "UTF-8";
10
11 public String getBasePath() {
12 return basePath;
13 }
14
15 public File getBaseDir(){
16 return new File(getBasePath());
17 }
18
19 public void setBasePath(String basePath) {
20 if (basePath.charAt(basePath.length() - 1) != File.separatorChar)
21 basePath = basePath + File.separatorChar;
22 this.basePath = basePath;
23 }
24
25 public String getEncoding() {
26 return encoding;
27 }
28
29 public void setEncoding(String encoding) {
30 this.encoding = encoding;
31 }
32
33 public File getFile(String relpath) {
34 return new File(getBasePath() + relpath).getAbsoluteFile();
35 }
36
37 public File getFile(String dir, String fileName) {
38 return getFile(dir + File.separator + fileName);
39 }
40 }