feature: Add language files to debugpaste
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
- [X] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
- [X] Ensure that the pull request title represents the desired changelog entry.
- [X] New public fields and methods are annotated with
@since TODO. - [X] I read and followed the contribution guidelines.
@SirYwell What would be the benefit of Files and Path?
@SirYwell What would be the benefit of
FilesandPath?
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
The change proposed doesn't work at all:
That looks like a bug with the IncendoPaster or the web service.
The change proposed doesn't work at all:
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.
The change proposed doesn't work at all:
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?
The error code is not from the Paster but sent from the Server. The files were all added successfully. I listed all files with Paster.listFiles(), which listed all files that were supposed to be added.
There is https://github.com/IntellectualSites/IncendoPasteViewer I guess? The web server itself runs on Kvantum: https://github.com/Citymonstret/Kvantum
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.
Is the server software accesible? The issue seems to be on the server side.
See
The web server itself runs on Kvantum: https://github.com/Citymonstret/Kvantum
@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. And I also don't understand why I'm supposed to debug it. I'm missing vital information to even have a hope of fixing this issue. I have no information on how the server is set up. You need to ask the server owner to debug, not me.
@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.