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

remove apache.commons.io #1289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions assemblies/psw-ce/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>pentaho</groupId>
<artifactId>mondrian</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions mondrian/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand Down
6 changes: 2 additions & 4 deletions mondrian/src/it/java/mondrian/test/SchemaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import mondrian.spi.PropertyFormatter;
import mondrian.util.Bug;

import org.apache.commons.io.IOUtils;
import org.apache.log4j.*;
import org.apache.log4j.varia.LevelRangeFilter;

import org.olap4j.metadata.NamedList;

import java.io.*;
import java.nio.file.Files;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -4827,9 +4827,7 @@ public void testMultiByteSchemaReadFromFile() throws IOException {
"<Hierarchy name=\"地域\" hasAll=\"true\" allMemberName=\"All Gender\" primaryKey=\"customer_id\">");
File schemaFile = File.createTempFile("multiByteSchema", ",xml");
schemaFile.deleteOnExit();
FileOutputStream output = new FileOutputStream(schemaFile);
IOUtils.write(rawSchema, output);
output.close();
Files.writeString(schemaFile.toPath(), rawSchema);
TestContext context = getTestContext();
final Util.PropertyList properties =
context.getConnectionProperties().clone();
Expand Down
11 changes: 8 additions & 3 deletions mondrian/src/main/java/mondrian/olap/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import java.util.regex.Pattern;

import org.apache.commons.collections.keyvalue.AbstractMapEntry;
import org.apache.commons.io.IOUtils;
import org.apache.commons.vfs2.FileContent;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
Expand Down Expand Up @@ -3443,9 +3442,15 @@ public static String readVirtualFileAsString(
{
InputStream in = readVirtualFile(catalogUrl);
try {
return IOUtils.toString(in);
return new String(in.readAllBytes());
} finally {
IOUtils.closeQuietly(in);
try {
if (in != null) {
in.close();
}
} catch (IOException ioe) {
// ignore
}
}
}

Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<olap4j.version>1.2.0</olap4j.version>
<eigenbase-properties.version>1.1.2</eigenbase-properties.version>
<commons-io.version>1.4</commons-io.version>
<mysql-connector-java.version>5.1.39</mysql-connector-java.version>
<olap4j-tck.version>1.0.1.539</olap4j-tck.version>
<eigenbase-resgen.version>1.3.1</eigenbase-resgen.version>
Expand Down
11 changes: 0 additions & 11 deletions workbench/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>pentaho</groupId>
<artifactId>mondrian</artifactId>
Expand Down
8 changes: 3 additions & 5 deletions workbench/src/main/java/mondrian/gui/Workbench.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import mondrian.server.MondrianServerRegistry;
import mondrian.util.UnionIterator;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;

import org.eigenbase.xom.XMLOutput;
Expand All @@ -42,6 +40,7 @@
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.nio.file.Files;
import java.util.*;
import java.util.List;
import javax.swing.*;
Expand Down Expand Up @@ -195,8 +194,7 @@ public void loadDatabaseMeta() {
File file = new File(DB_META_CONFIG_FILE);
if (file.exists()) {
try {
final String fileContents =
FileUtils.readFileToString(file);
final String fileContents =Files.readString(file.toPath());
if (Util.isBlank(fileContents)) {
LOGGER.error(
"DB Meta file is empty at: "
Expand Down Expand Up @@ -1095,7 +1093,7 @@ private void aboutMenuItemActionPerformed(ActionEvent evt) {
URL versionUrl = myClassLoader.getResource(
getResourceConverter().getGUIReference("version"));
InputStream versionIn = versionUrl.openStream();
String ver = IOUtils.toString(versionIn);
String ver = new String(versionIn.readAllBytes());
ver = ver.replace(
"PRODUCT_VERSION",
MondrianServerRegistry.INSTANCE.getProductVersion());
Expand Down