3737import org .apache .commons .compress .archivers .tar .TarArchiveInputStream ;
3838import org .apache .commons .compress .compressors .gzip .GzipCompressorInputStream ;
3939import org .apache .commons .compress .compressors .gzip .GzipUtils ;
40- import org .apache .commons .lang3 .StringUtils ;
40+ import org .apache .commons .lang3 .Strings ;
4141import org .apache .commons .lang3 .builder .ToStringBuilder ;
4242import org .efaps .admin .AppConfigHandler ;
4343import org .efaps .admin .program .esjp .EFapsApplication ;
@@ -79,15 +79,13 @@ public abstract class AbstractUpdate
7979
8080 private static final Logger LOG = LoggerFactory .getLogger (AbstractUpdate .class );
8181
82- protected Map <String , URL > getFiles (final String _fileName ,
83- final InputStream _inputStream )
82+ protected Map <String , URL > getFiles (final String fileName ,
83+ final InputStream inputStream )
8484 {
8585 final Map <String , URL > files = new HashMap <>();
86- final boolean compress = GzipUtils .isCompressedFilename (_fileName );
87- try (
88-
89- TarArchiveInputStream tarInput = new TarArchiveInputStream (
90- compress ? new GzipCompressorInputStream (_inputStream ) : _inputStream );) {
86+ final boolean compress = GzipUtils .isCompressedFileName (fileName );
87+ try (var tarInput = new TarArchiveInputStream (
88+ compress ? new GzipCompressorInputStream (inputStream ) : inputStream );) {
9189
9290 File tmpfld = AppConfigHandler .get ().getTempFolder ();
9391 if (tmpfld == null ) {
@@ -102,7 +100,7 @@ protected Map<String, URL> getFiles(final String _fileName,
102100 final File dateFolder = new File (updateFolder , ((Long ) new Date ().getTime ()).toString ());
103101 dateFolder .mkdirs ();
104102
105- TarArchiveEntry currentEntry = tarInput .getNextTarEntry ();
103+ TarArchiveEntry currentEntry = tarInput .getNextEntry ();
106104 while (currentEntry != null ) {
107105 final byte [] bytess = new byte [(int ) currentEntry .getSize ()];
108106 tarInput .read (bytess );
@@ -112,7 +110,7 @@ protected Map<String, URL> getFiles(final String _fileName,
112110 output .write (bytess );
113111 output .close ();
114112 files .put (currentEntry .getName (), file .toURI ().toURL ());
115- currentEntry = tarInput .getNextTarEntry ();
113+ currentEntry = tarInput .getNextEntry ();
116114 }
117115
118116 } catch (final IOException e ) {
@@ -547,8 +545,8 @@ public URL getURL(final Map<String, URL> _files)
547545 {
548546 final URL ret = switch (getFileType ()) {
549547 case JAVA -> _files .get (getIdentifier ().replace ('.' , '/' ) + ".java" );
550- case CSS -> _files .get (StringUtils .removeEnd (getIdentifier (), ".css" ).replace ('.' , '/' ) + ".css" );
551- case JS -> _files .get (StringUtils .removeEnd (getIdentifier (), ".js" ).replace ('.' , '/' ) + ".js" );
548+ case CSS -> _files .get (Strings . CS .removeEnd (getIdentifier (), ".css" ).replace ('.' , '/' ) + ".css" );
549+ case JS -> _files .get (Strings . CS .removeEnd (getIdentifier (), ".js" ).replace ('.' , '/' ) + ".js" );
552550 case JRXML -> _files .get (getIdentifier () + ".jrxml" );
553551 default -> _files .get (getIdentifier ());
554552 };
0 commit comments