Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#245 Remove unused method binding to commons.io dependency in API module #246

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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