-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
feature: Add language files to debugpaste #3645
base: main
Are you sure you want to change the base?
feature: Add language files to debugpaste #3645
Conversation
Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
Outdated
Show resolved
Hide resolved
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'd prefer the usage of java nio Files
and Path
, and with proper null checks rather than catching NPEs.
@SirYwell What would be the benefit of |
It's the more modern API, it has better exception handling and less magic null values. In best case, we could get rid of any java.io.File usages altogether, but that's clearly out of scope for this PR. In this case, the code could be written like Path langDir = PlotSquared.platform().getDirectory().toPath().resolve("lang");
if (Files.isDirectory(langDir)) {
Files.list(langDir)
.filter(Files::isRegularFile)
.filter(path -> path.getFileName().startsWith("message_") && path.getFileName().toString().endsWith(".json"))
.forEach(path -> incendoPaster.addFile(path.toFile())); or something like that (I just wrote it down quickly). |
You never stop learning. Thanks for explaining @SirYwell |
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.
The change proposed doesn't work at all:
[P2] Failed to create the debugpaste: request must contain a file list
Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
Outdated
Show resolved
Hide resolved
That looks like a bug with the IncendoPaster or the web service. |
If that is true, this PR must remain on hold until a mandatory PR has been filed against the Paster repository to address this issue, if that is actually an issue, or implement it as feature. |
@NotMyFault That is the repository for the Java library. Is the code of the web service accessible? |
There is https://github.com/IntellectualSites/IncendoPasteViewer I guess? |
It looks like that is an issue in the IncendoPasteViewer itself: https://github.com/IntellectualSites/IncendoPasteViewer/blob/master/src/main/java/org/incendo/paste/rest/UploadService.java#L95 |
Is the server software accesible? The issue seems to be on the server side. |
See
|
@NotMyFault How is the raw code of the web server relevant? As the server only natively serves static content, you either have another software handling incoming files or Kvantum does more than it states in the Readme. @dordsor21 seems to be involved in the server, maybe he can help. Or if it is true, that kvantum is handling both serving and receiving files, then maybe @Citymonstret can help. I have done what was asked of me. I implemented the change in PlotSquares code. Everything else is the Problem of IntellectualSites. |
Overview
Fixes #3176
Description
This should add all language files to the debugpaste.
This currently doesn't work!
The response is always, that a file list needs to be provided in the request, which is obviously the case. I suspect, that there need to be server-side changes for it to accept those files.
Submitter Checklist
@since TODO
.