ソースを参照

[MRM-709] Use commons-io instead of Plexus Utils

* Some more IOUtil and FileUtil conversions.



git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@636993 13f79535-47bb-0310-9956-ffa450edef68
tags/archiva-r676265
Joakim Erdfelt 16年前
コミット
1e7c8f6da4

+ 5
- 4
archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecordLoader.java ファイルの表示

@@ -9,7 +9,7 @@ package org.apache.maven.archiva.indexer.bytecode;
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -20,10 +20,11 @@ package org.apache.maven.archiva.indexer.bytecode;
*/

import junit.framework.AssertionFailedError;

import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails;
import org.apache.maven.archiva.model.platform.JavaArtifactHelper;
import org.codehaus.plexus.util.IOUtil;

import java.io.BufferedReader;
import java.io.File;
@@ -125,8 +126,8 @@ public class BytecodeRecordLoader
}
finally
{
IOUtil.close( reader );
IOUtil.close( freader );
IOUtils.closeQuietly( reader );
IOUtils.closeQuietly( freader );
}

// cache.put( artifact, record );

+ 3
- 3
archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecordLoader.java ファイルの表示

@@ -19,10 +19,10 @@ package org.apache.maven.archiva.indexer.hashcodes;
* under the License.
*/

import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails;
import org.apache.maven.archiva.model.platform.JavaArtifactHelper;
import org.codehaus.plexus.util.IOUtil;

import java.io.BufferedReader;
import java.io.File;
@@ -97,8 +97,8 @@ public class HashcodesRecordLoader
}
finally
{
IOUtil.close( reader );
IOUtil.close( freader );
IOUtils.closeQuietly( reader );
IOUtils.closeQuietly( freader );
}

return record;

+ 4
- 0
archiva-base/archiva-transaction/pom.xml ファイルの表示

@@ -28,6 +28,10 @@
<name>Archiva Transactions</name>
<description>API for managing transaction.</description>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>

+ 6
- 12
archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/AbstractTransactionEvent.java ファイルの表示

@@ -19,10 +19,10 @@ package org.apache.maven.archiva.transaction;
* under the License.
*/

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.digest.Digester;
import org.codehaus.plexus.digest.DigesterException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;

import java.io.File;
import java.io.FileOutputStream;
@@ -215,19 +215,13 @@ public abstract class AbstractTransactionEvent
}
}

/**
* TODO: Remove in favor of using FileUtils directly.
*/
protected void writeStringToFile( File file, String content )
throws IOException
{
FileOutputStream out = null;
try
{
out = new FileOutputStream( file );
IOUtil.copy( content, out );
}
finally
{
IOUtil.close( out );
}
FileUtils.writeStringToFile( file, content );
}

/**

+ 2
- 2
archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/AbstractFileEventTest.java ファイルの表示

@@ -19,9 +19,9 @@ package org.apache.maven.archiva.transaction;
* under the License.
*/

import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.digest.Digester;
import org.codehaus.plexus.util.IOUtil;

import java.io.File;
import java.io.FileInputStream;
@@ -85,7 +85,7 @@ public abstract class AbstractFileEventTest
try
{
in = new FileInputStream( file );
return IOUtil.toString( in );
return IOUtils.toString( in );
}
finally
{

読み込み中…
キャンセル
保存