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

Bump org.apache.commons:commons-compress from 1.24.0 to 1.26.0 in /airsonic-main #376

Merged
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
3 changes: 2 additions & 1 deletion airsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
</dependency>

<dependency>
Expand All @@ -228,7 +229,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.24.0</version>
<version>1.26.0</version>
</dependency>
<dependency>
<!-- compression library-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private Resource getExternalResource(Path captionsFile, String format) throws IO
if (CAPTION_FORMAT_VTT.equals(format)) {
return new PathResource(captionsFile);
} else {
return new InputStreamResource(new BOMInputStream(Files.newInputStream(captionsFile)));
return new InputStreamResource(BOMInputStream.builder().setInputStream(Files.newInputStream(captionsFile)).get());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ protected ModelAndView handleRequestInternal(HttpServletRequest request,

private static List<String> getLatestLogEntries(Path logFile) {
List<String> lines = new LinkedList<>();
try (ReversedLinesFileReader reader = new ReversedLinesFileReader(logFile.toFile(), Charset.defaultCharset())) {
try (ReversedLinesFileReader reader = ReversedLinesFileReader.builder().setFile(logFile.toFile())
.setCharset(Charset.defaultCharset()).get()) {
String current;
while ((current = reader.readLine()) != null) {
if (lines.size() >= LOG_LINES_TO_SHOW) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public Date getLastModifiedDate() {
// zip files
if (file.getFileName().toString().toLowerCase().endsWith(".zip")) {
LOG.info("Trying zip-specific extraction method for {}", file);
try (FileChannel channel = FileChannel.open(file); ZipFile zip = new ZipFile(channel)) {
try (FileChannel channel = FileChannel.open(file);
ZipFile zip = ZipFile.builder().setSeekableByteChannel(channel).get()) {
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
ZipArchiveEntry entry = null;
while (entries.hasMoreElements()) {
Expand All @@ -292,7 +293,8 @@ public Date getLastModifiedDate() {
// 7z files
if (file.getFileName().toString().toLowerCase().endsWith(".7z")) {
LOG.info("Trying 7z-specific extraction method for {}", file);
try (FileChannel channel = FileChannel.open(file); SevenZFile zip = new SevenZFile(channel)) {
try (FileChannel channel = FileChannel.open(file);
SevenZFile zip = SevenZFile.builder().setSeekableByteChannel(channel).get()) {
byte[] buffer = new byte[8042];
SevenZArchiveEntry entry = null;
while ((entry = zip.getNextEntry()) != null) {
Expand All @@ -318,7 +320,7 @@ public Date getLastModifiedDate() {
if (!unzipped) {
LOG.info("Trying a generic extraction method for {}", file);
try (BufferedInputStream bis = new BufferedInputStream(Files.newInputStream(file));
ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(bis)) {
ArchiveInputStream<ArchiveEntry> ais = new ArchiveStreamFactory().createArchiveInputStream(bis)) {
ArchiveEntry entry = null;
while ((entry = ais.getNextEntry()) != null) {
if (!ais.canReadEntryData(entry)) {
Expand Down