-
Notifications
You must be signed in to change notification settings - Fork 108
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
feat: add support for gzip archive files #157
Conversation
I figured out the issue when I checked the WS response (server log was silient though)... the issue was related to logs path config... I was customized it to look into some specified folder in '/mnt/logs' So to fix the issue, I added
in my config file as well to So it has nothing to do with PR, unless the user should be aware of the paths config in such case! |
Thanks! Good idea. |
Don't change |
I searched the entire code base but didn't find a track for |
I've updated the PR by suggested comments:
|
log-viewer-frontend/src/app/log-navigator/log-navigator.component.ts
Outdated
Show resolved
Hide resolved
I mean you have to add |
tempFile.deleteOnExit(); | ||
|
||
try (GZIPInputStream gis = new GZIPInputStream( | ||
Files.newInputStream(file.toFile().toPath())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary to convert it to File, and then back to Path? Or is it just mistake?
@@ -141,6 +147,25 @@ public Snapshot createSnapshot() { | |||
} | |||
} | |||
|
|||
private void decompressAndCopyGZipFile() throws IOException { | |||
|
|||
File tempFile = File.createTempFile("log-viewer-", "-" + file.getName(file.getNameCount() - 1) + ".tmp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to change it to NIO2
Path tempFile = Files.createTempFile("log-viewer-", "-" + file.getName(file.getNameCount() - 1) + ".tmp");
Files.deleteIfExists(tempFile);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some searches, and find out there's no direct way in java nio API to get from gz to SeekableByteChannel.
I have to introduce some external dependencies and/or write custom code to accomplish this.
I appreciate your help on this.
BTW, I did other changes as well to suit needs Let me know if any interesting feature that I can contribute back |
I added the following changes after merge: |
Good, Thanks 🌹 |
This PR is to support
gz
files as asked in #132 and #131