Skip to content

Commit

Permalink
Remove IOUtil dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Sep 25, 2023
1 parent a3f1b5d commit a359f39
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/main/java/net/md_5/specialsource/mavenplugin/RemapMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package net.md_5.specialsource.mavenplugin;

import com.google.common.io.Files;
import net.md_5.specialsource.*;
import net.md_5.specialsource.provider.JarProvider;
import net.md_5.specialsource.provider.JointProvider;
Expand All @@ -29,7 +30,6 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.util.IOUtil;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.DefaultArtifact;
Expand All @@ -40,8 +40,6 @@
import org.eclipse.aether.transfer.ArtifactNotFoundException;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

Expand Down Expand Up @@ -288,17 +286,7 @@ private void replaceFile( File oldFile, File newFile )
// Still didn't work. We'll do a copy
try
{
FileOutputStream fout = new FileOutputStream( origFile );
FileInputStream fin = new FileInputStream( oldFile );
try
{
IOUtil.copy(fin, fout);
}
finally
{
IOUtil.close( fin );
IOUtil.close( fout );
}
Files.copy( oldFile, newFile );
}
catch ( IOException ex )
{
Expand All @@ -318,17 +306,7 @@ private void replaceFile( File oldFile, File newFile )
// Still didn't work. We'll do a copy
try
{
FileOutputStream fout = new FileOutputStream( oldFile );
FileInputStream fin = new FileInputStream( newFile );
try
{
IOUtil.copy( fin, fout );
}
finally
{
IOUtil.close( fin );
IOUtil.close( fout );
}
Files.copy( oldFile, newFile );
}
catch ( IOException ex )
{
Expand Down

0 comments on commit a359f39

Please sign in to comment.