-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop legacy plexus API and use only JSR330 components (#220)
Drop: - plexus container default - legacy plexus APIs like Contextualizable - drop Plexus Logger uses - some minor cleanups for Java8 level - converted Plexus XML to JSR330 - dropped plexus container (so no pcd or shim) as it is not needed anymore, plexus-io is not plx anymore as well This is a breaking change (for example Plexus vs Slf4j logger use on APIs), so version bump is imminent.
- Loading branch information
Showing
123 changed files
with
1,717 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,26 +26,34 @@ | |
import java.util.Date; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
import java.util.concurrent.atomic.LongAdder; | ||
|
||
import org.codehaus.plexus.archiver.util.ArchiveEntryUtils; | ||
import org.codehaus.plexus.components.io.attributes.SymlinkUtils; | ||
import org.codehaus.plexus.components.io.filemappers.FileMapper; | ||
import org.codehaus.plexus.components.io.fileselectors.FileSelector; | ||
import org.codehaus.plexus.components.io.resources.PlexusIoResource; | ||
import org.codehaus.plexus.logging.AbstractLogEnabled; | ||
import org.codehaus.plexus.util.FileUtils; | ||
import org.codehaus.plexus.util.IOUtil; | ||
import org.codehaus.plexus.util.StringUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
// TODO there should really be constructors which take the source file. | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a> | ||
*/ | ||
public abstract class AbstractUnArchiver | ||
extends AbstractLogEnabled | ||
implements UnArchiver, FinalizerEnabled | ||
{ | ||
private final Logger logger = LoggerFactory.getLogger( getClass() ); | ||
|
||
protected Logger getLogger() | ||
{ | ||
return logger; | ||
} | ||
|
||
private File destDirectory; | ||
|
||
|
@@ -384,6 +392,11 @@ else if ( isDirectory ) | |
} | ||
} | ||
|
||
/** | ||
* Counter for casing message emitted, visible for testing. | ||
*/ | ||
final AtomicInteger casingMessageEmitted = new AtomicInteger( 0 ); | ||
|
||
// Visible for testing | ||
protected boolean shouldExtractEntry( File targetDirectory, File targetFileName, String entryName, Date entryDate ) throws IOException | ||
{ | ||
|
@@ -423,6 +436,7 @@ protected boolean shouldExtractEntry( File targetDirectory, File targetFileName, | |
if ( differentCasing ) | ||
{ | ||
getLogger().warn( casingMessage ); | ||
casingMessageEmitted.incrementAndGet(); | ||
} | ||
return false; | ||
} | ||
|
@@ -431,6 +445,7 @@ protected boolean shouldExtractEntry( File targetDirectory, File targetFileName, | |
if ( differentCasing ) | ||
{ | ||
getLogger().warn( casingMessage ); | ||
casingMessageEmitted.incrementAndGet(); | ||
} | ||
|
||
// (2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.