Skip to content

Commit

Permalink
#245 Remove unused method binding to commons.io dependency in API mod…
Browse files Browse the repository at this point in the history
…ule (#246)
  • Loading branch information
mawiesne authored Oct 29, 2023
1 parent b52e4a9 commit 2403f7d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
4 changes: 0 additions & 4 deletions dkpro-jwpl-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<groupId>de.fau.cs.osr.ptk</groupId>
<artifactId>ptk-common</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>org.sweble.wikitext</groupId>
<artifactId>swc-parser-lazy</artifactId>
Expand Down
35 changes: 0 additions & 35 deletions dkpro-jwpl-api/src/main/java/org/dkpro/jwpl/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
*/
package org.dkpro.jwpl.util;

import java.io.File;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -54,38 +51,6 @@ public static String join(Collection<?> c, String delimiter) {
return buffer.toString();
}

public static String getFileContent(String filename, String encoding) {

// File file = new File(filename);
//
// InputStream is;
// String textContents = "";
// try {
// is = new FileInputStream(file);
// // as the whole file is read at once -> buffering not necessary
// // InputStream is = new BufferedInputStream(new
// FileInputStream(file));
// byte[] contents = new byte[(int) file.length()];
// is.read(contents);
// textContents = new String(contents, encoding);
// } catch (FileNotFoundException e) {
// logger.error("File " + file.getAbsolutePath() + " not found.");
// e.printStackTrace();
// } catch (IOException e) {
// logger.error("IO exception while reading file " +
// file.getAbsolutePath());
// e.printStackTrace();
// }
File file = new File(filename);
try {
return FileUtils.readFileToString(file, encoding);
} catch (IOException e) {
logger.error("Exception while reading file " + file.getAbsolutePath(), e);
return "";
}

}

/**
* Replaces all problematic characters from a String with their escaped
* versions to make it SQL conform.
Expand Down
2 changes: 2 additions & 0 deletions dkpro-jwpl-deps/dkpro-jwpl-swc-engine-shade/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>de.fau.cs.osr.ptk</groupId>
Expand Down

0 comments on commit 2403f7d

Please sign in to comment.