Skip to content
Browse files

Fixed compilation error for jdk5 + missing dependencies

  • Loading branch information...
1 parent 2bf24e8 commit be0b637066c5429c542af7c7901240274fc385ef anw committed Apr 15, 2012
View
15 pom.xml
@@ -80,5 +80,20 @@
<artifactId>mime-util</artifactId>
<version>2.1.3</version>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.6</version>
+ </dependency>
</dependencies>
</project>
View
5 src/main/java/my/sample/MySampleServlet.java
@@ -2,15 +2,10 @@
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-
import org.elfinder.servlets.AbstractConnectorServlet;
-import org.elfinder.servlets.commands.AbstractCommand;
import org.elfinder.servlets.config.AbstractConnectorConfig;
-import com.sun.xml.internal.ws.util.StringUtils;
-
/**
* @author Antoine Walter (www.anw.fr)
* @date 29 aug. 2011
View
2 src/main/java/org/elfinder/servlets/AbstractConnectorServlet.java
@@ -25,7 +25,7 @@
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.elfinder.servlets.commands.AbstractCommand;
import org.elfinder.servlets.commands.ContentCommand;
View
2 src/main/java/org/elfinder/servlets/config/AbstractConnectorConfig.java
@@ -8,11 +8,9 @@
import javax.activation.MimetypesFileTypeMap;
-import org.apache.commons.lang.ArrayUtils;
import org.elfinder.servlets.FileActionEnum;
import org.elfinder.servlets.fs.IFsImpl;
-
import eu.medsea.mimeutil.MimeType;
import eu.medsea.mimeutil.MimeUtil;
View
10 src/main/java/org/elfinder/servlets/fs/DiskFsImpl.java
@@ -35,7 +35,6 @@ protected AbstractConnectorConfig getConfig() {
return config;
}
- @Override
public void createFile(File newFile, ByteArrayOutputStream os) throws FsException {
if (os == null) {
os = new ByteArrayOutputStream();
@@ -58,23 +57,20 @@ public void createFile(File newFile, ByteArrayOutputStream os) throws FsExceptio
}
}
- @Override
public void createFolder(File folder) throws FsException {
boolean ok = folder.mkdir();
if (!ok) {
throw new FsException("Unable to create folder");
}
}
- @Override
public void renameFileOrDirectory(File targetFile, File futureFile) throws FsException {
boolean ok = targetFile.renameTo(futureFile);
if (!ok) {
throw new FsException("Unable to rename file from " + targetFile.getPath() + " to " + futureFile.getPath());
}
}
- @Override
public void copyFileOrDirectory(File targetFile, File futureFile) throws FsException {
boolean ok = true;
try {
@@ -91,7 +87,6 @@ public void copyFileOrDirectory(File targetFile, File futureFile) throws FsExcep
}
}
- @Override
public void moveFile(File file, File futureFile) throws FsException {
// renameTo doesn't always work on windows?
try {
@@ -104,31 +99,26 @@ public void moveFile(File file, File futureFile) throws FsException {
}
}
- @Override
public void removeFile(File path) throws FsException {
if (!path.delete()) {
throw new FsException("Unable to remove file");
}
}
- @Override
public void removeEmptyDirectory(File path) throws FsException {
if (!path.delete()) {
throw new FsException("Unable to remove directory");
}
}
- @Override
public boolean isAllowedFile(File file) {
return true;
}
- @Override
public long getDirSize(File dir) {
return FileUtils.sizeOfDirectory(dir);
}
- @Override
public long getFileSize(File file) {
return file.length();
}

0 comments on commit be0b637

Please sign in to comment.
Something went wrong with that request. Please try again.