Remove Eclipse-specific markers (comments)
All checks were successful
Build / build (push) Successful in 33s

This commit is contained in:
Tobi Schäfer 2025-04-09 23:09:23 +02:00
parent fe81de07e3
commit a9f02635f1
Signed by: tobi
GPG key ID: 91FAE6FE2EBAC4C8
7 changed files with 73 additions and 73 deletions

View file

@ -115,13 +115,13 @@ public class Main {
File[] files = dir.listFiles(new FilenameFilter() { File[] files = dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) { public boolean accept(File dir, String name) {
String n = name.toLowerCase(); String n = name.toLowerCase();
return n.endsWith(".jar") || n.endsWith(".zip"); //$NON-NLS-1$//$NON-NLS-2$ return n.endsWith(".jar") || n.endsWith(".zip");
} }
}); });
if (files != null) { if (files != null) {
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
jarlist.add(new URL("file:" + files[i].getAbsolutePath())); //$NON-NLS-1$ jarlist.add(new URL("file:" + files[i].getAbsolutePath()));
} }
} }
} }
@ -149,7 +149,7 @@ public class Main {
addJars(jarlist, libdir); addJars(jarlist, libdir);
// add all jar files from the lib/ext directory // add all jar files from the lib/ext directory
addJars(jarlist, new File(libdir, "ext")); //$NON-NLS-1$ addJars(jarlist, new File(libdir, "ext"));
URL[] urls = new URL[jarlist.size()]; URL[] urls = new URL[jarlist.size()];
@ -199,7 +199,7 @@ public class Main {
// try to get Helma installation directory // try to get Helma installation directory
if (installDir == null) { if (installDir == null) {
URL launcherUrl = ClassLoader.getSystemClassLoader() URL launcherUrl = ClassLoader.getSystemClassLoader()
.getResource("helma/main/launcher/Main.class"); //$NON-NLS-1$ .getResource("helma/main/launcher/Main.class");
// this is a JAR URL of the form // this is a JAR URL of the form
// jar:<url>!/{entry} // jar:<url>!/{entry}

View file

@ -603,11 +603,11 @@ public class RequestTrans implements Serializable {
StringTokenizer tok; StringTokenizer tok;
if (auth.startsWith("Basic ")) { //$NON-NLS-1$ if (auth.startsWith("Basic ")) {
tok = new StringTokenizer(new String(Base64.decodeBase64(auth.substring(6))), tok = new StringTokenizer(new String(Base64.decodeBase64(auth.substring(6))),
":"); //$NON-NLS-1$ ":");
} else { } else {
tok = new StringTokenizer(new String(Base64.decodeBase64(auth)), ":"); //$NON-NLS-1$ tok = new StringTokenizer(new String(Base64.decodeBase64(auth)), ":");
} }
try { try {

View file

@ -714,7 +714,7 @@ public final class ResponseTrans extends Writer implements Serializable {
// if (contentType != null) // if (contentType != null)
// digest.update (contentType.getBytes()); // digest.update (contentType.getBytes());
byte[] b = this.digest.digest(this.response); byte[] b = this.digest.digest(this.response);
this.etag = "\"" + new String(Base64.encodeBase64(b)) + "\""; //$NON-NLS-1$ //$NON-NLS-2$ this.etag = "\"" + new String(Base64.encodeBase64(b)) + "\"";
// only set response to 304 not modified if no cookies were set // only set response to 304 not modified if no cookies were set
if (reqtrans.hasETag(etag) && countCookies() == 0) { if (reqtrans.hasETag(etag) && countCookies() == 0) {
response = new byte[0]; response = new byte[0];

View file

@ -71,7 +71,7 @@ public class ApplicationManager implements XmlRpcHandler {
for (Enumeration<?> e = this.props.keys(); e.hasMoreElements();) { for (Enumeration<?> e = this.props.keys(); e.hasMoreElements();) {
String appName = (String) e.nextElement(); String appName = (String) e.nextElement();
if ((appName.indexOf(".") == -1) && //$NON-NLS-1$ if ((appName.indexOf(".") == -1) &&
(this.applications.get(appName) == null)) { (this.applications.get(appName) == null)) {
AppDescriptor appDesc = new AppDescriptor(appName); AppDescriptor appDesc = new AppDescriptor(appName);
appDesc.start(); appDesc.start();
@ -149,7 +149,7 @@ public class ApplicationManager implements XmlRpcHandler {
for (Enumeration<?> e = this.props.keys(); e.hasMoreElements();) { for (Enumeration<?> e = this.props.keys(); e.hasMoreElements();) {
String appName = (String) e.nextElement(); String appName = (String) e.nextElement();
if (appName.indexOf(".") == -1) { //$NON-NLS-1$ if (appName.indexOf(".") == -1) {
String appValue = this.props.getProperty(appName); String appValue = this.props.getProperty(appName);
if (appValue != null && appValue.length() > 0) { if (appValue != null && appValue.length() > 0) {
@ -208,7 +208,7 @@ public class ApplicationManager implements XmlRpcHandler {
*/ */
public Object execute(String method, @SuppressWarnings("rawtypes") Vector params) public Object execute(String method, @SuppressWarnings("rawtypes") Vector params)
throws Exception { throws Exception {
int dot = method.indexOf("."); //$NON-NLS-1$ int dot = method.indexOf(".");
if (dot == -1) { if (dot == -1) {
throw new Exception("Method name \"" + method + throw new Exception("Method name \"" + method +
@ -224,7 +224,7 @@ public class ApplicationManager implements XmlRpcHandler {
Application app = (Application) this.xmlrpcHandlers.get(handler); Application app = (Application) this.xmlrpcHandlers.get(handler);
if (app == null) { if (app == null) {
app = (Application) this.xmlrpcHandlers.get("*"); //$NON-NLS-1$ app = (Application) this.xmlrpcHandlers.get("*");
// use the original method name, the handler is resolved within the app. // use the original method name, the handler is resolved within the app.
method2 = method; method2 = method;
} }
@ -239,32 +239,32 @@ public class ApplicationManager implements XmlRpcHandler {
private String getMountpoint(String mountpoint) { private String getMountpoint(String mountpoint) {
mountpoint = mountpoint.trim(); mountpoint = mountpoint.trim();
if ("".equals(mountpoint)) { //$NON-NLS-1$ if ("".equals(mountpoint)) {
return "/"; //$NON-NLS-1$ return "/";
} else if (!mountpoint.startsWith("/")) { //$NON-NLS-1$ } else if (!mountpoint.startsWith("/")) {
return "/" + mountpoint; //$NON-NLS-1$ return "/" + mountpoint;
} }
return mountpoint; return mountpoint;
} }
private String joinMountpoint(String prefix, String suffix) { private String joinMountpoint(String prefix, String suffix) {
if (prefix.endsWith("/") || suffix.startsWith("/")) { //$NON-NLS-1$//$NON-NLS-2$ if (prefix.endsWith("/") || suffix.startsWith("/")) {
return prefix+suffix; return prefix+suffix;
} }
return prefix+"/"+suffix; //$NON-NLS-1$ return prefix+"/"+suffix;
} }
private String getPathPattern(String mountpoint) { private String getPathPattern(String mountpoint) {
if (!mountpoint.startsWith("/")) { //$NON-NLS-1$ if (!mountpoint.startsWith("/")) {
mountpoint = "/"+mountpoint; //$NON-NLS-1$ mountpoint = "/"+mountpoint;
} }
if ("/".equals(mountpoint)) { //$NON-NLS-1$ if ("/".equals(mountpoint)) {
return "/"; //$NON-NLS-1$ return "/";
} }
if (mountpoint.endsWith("/")) { //$NON-NLS-1$ if (mountpoint.endsWith("/")) {
return mountpoint.substring(0, mountpoint.length()-1); return mountpoint.substring(0, mountpoint.length()-1);
} }
@ -335,56 +335,56 @@ public class ApplicationManager implements XmlRpcHandler {
AppDescriptor(String name) { AppDescriptor(String name) {
ResourceProperties conf = ApplicationManager.this.props.getSubProperties(name + '.'); ResourceProperties conf = ApplicationManager.this.props.getSubProperties(name + '.');
this.appName = name; this.appName = name;
this.mountpoint = getMountpoint(conf.getProperty("mountpoint", this.appName)); //$NON-NLS-1$ this.mountpoint = getMountpoint(conf.getProperty("mountpoint", this.appName));
this.pathPattern = getPathPattern(this.mountpoint); this.pathPattern = getPathPattern(this.mountpoint);
this.staticDir = conf.getProperty("static"); //$NON-NLS-1$ this.staticDir = conf.getProperty("static");
this.staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint", //$NON-NLS-1$ this.staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint",
joinMountpoint(this.mountpoint, "static"))); //$NON-NLS-1$ joinMountpoint(this.mountpoint, "static")));
this.staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex")); //$NON-NLS-1$//$NON-NLS-2$ this.staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex"));
String home = conf.getProperty("staticHome"); //$NON-NLS-1$ String home = conf.getProperty("staticHome");
if (home == null) { if (home == null) {
this.staticHome = new String[] {"index.html", "index.htm"}; //$NON-NLS-1$ //$NON-NLS-2$ this.staticHome = new String[] {"index.html", "index.htm"};
} else { } else {
this.staticHome = StringUtils.split(home, ","); //$NON-NLS-1$ this.staticHome = StringUtils.split(home, ",");
} }
this.protectedStaticDir = conf.getProperty("protectedStatic"); //$NON-NLS-1$ this.protectedStaticDir = conf.getProperty("protectedStatic");
this.cookieDomain = conf.getProperty("cookieDomain"); //$NON-NLS-1$ this.cookieDomain = conf.getProperty("cookieDomain");
this.sessionCookieName = conf.getProperty("sessionCookieName"); //$NON-NLS-1$ this.sessionCookieName = conf.getProperty("sessionCookieName");
this.protectedSessionCookie = conf.getProperty("protectedSessionCookie"); //$NON-NLS-1$ this.protectedSessionCookie = conf.getProperty("protectedSessionCookie");
this.uploadLimit = conf.getProperty("uploadLimit"); //$NON-NLS-1$ this.uploadLimit = conf.getProperty("uploadLimit");
this.uploadSoftfail = conf.getProperty("uploadSoftfail"); //$NON-NLS-1$ this.uploadSoftfail = conf.getProperty("uploadSoftfail");
this.debug = conf.getProperty("debug"); //$NON-NLS-1$ this.debug = conf.getProperty("debug");
String appDirName = conf.getProperty("appdir"); //$NON-NLS-1$ String appDirName = conf.getProperty("appdir");
this.appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName); this.appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName);
String dbDirName = conf.getProperty("dbdir"); //$NON-NLS-1$ String dbDirName = conf.getProperty("dbdir");
this.dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName); this.dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName);
this.servletClassName = conf.getProperty("servletClass"); //$NON-NLS-1$ this.servletClassName = conf.getProperty("servletClass");
// got ignore dirs // got ignore dirs
this.ignoreDirs = conf.getProperty("ignore"); //$NON-NLS-1$ this.ignoreDirs = conf.getProperty("ignore");
// read and configure app repositories // read and configure app repositories
ArrayList<Repository> repositoryList = new ArrayList<>(); ArrayList<Repository> repositoryList = new ArrayList<>();
Class<?>[] parameters = { String.class }; Class<?>[] parameters = { String.class };
for (int i = 0; true; i++) { for (int i = 0; true; i++) {
String repositoryArgs = conf.getProperty("repository." + i); //$NON-NLS-1$ String repositoryArgs = conf.getProperty("repository." + i);
if (repositoryArgs != null) { if (repositoryArgs != null) {
// lookup repository implementation // lookup repository implementation
String repositoryImpl = conf.getProperty("repository." + i + //$NON-NLS-1$ String repositoryImpl = conf.getProperty("repository." + i +
".implementation"); //$NON-NLS-1$ ".implementation");
if (repositoryImpl == null) { if (repositoryImpl == null) {
// implementation not set manually, have to guess it // implementation not set manually, have to guess it
if (repositoryArgs.endsWith(".zip")) { //$NON-NLS-1$ if (repositoryArgs.endsWith(".zip")) {
repositoryArgs = findResource(repositoryArgs); repositoryArgs = findResource(repositoryArgs);
repositoryImpl = "helma.framework.repository.ZipRepository"; //$NON-NLS-1$ repositoryImpl = "helma.framework.repository.ZipRepository";
} else if (repositoryArgs.endsWith(".js")) { //$NON-NLS-1$ } else if (repositoryArgs.endsWith(".js")) {
repositoryArgs = findResource(repositoryArgs); repositoryArgs = findResource(repositoryArgs);
repositoryImpl = "helma.framework.repository.SingleFileRepository"; //$NON-NLS-1$ repositoryImpl = "helma.framework.repository.SingleFileRepository";
} else { } else {
repositoryArgs = findResource(repositoryArgs); repositoryArgs = findResource(repositoryArgs);
repositoryImpl = "helma.framework.repository.FileRepository"; //$NON-NLS-1$ repositoryImpl = "helma.framework.repository.FileRepository";
} }
} }
@ -506,27 +506,27 @@ public class ApplicationManager implements XmlRpcHandler {
appContext.addServlet(holder, "/*"); appContext.addServlet(holder, "/*");
if (this.cookieDomain != null) { if (this.cookieDomain != null) {
holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$ holder.setInitParameter("cookieDomain", this.cookieDomain);
} }
if (this.sessionCookieName != null) { if (this.sessionCookieName != null) {
holder.setInitParameter("sessionCookieName", this.sessionCookieName); //$NON-NLS-1$ holder.setInitParameter("sessionCookieName", this.sessionCookieName);
} }
if (this.protectedSessionCookie != null) { if (this.protectedSessionCookie != null) {
holder.setInitParameter("protectedSessionCookie", this.protectedSessionCookie); //$NON-NLS-1$ holder.setInitParameter("protectedSessionCookie", this.protectedSessionCookie);
} }
if (this.uploadLimit != null) { if (this.uploadLimit != null) {
holder.setInitParameter("uploadLimit", this.uploadLimit); //$NON-NLS-1$ holder.setInitParameter("uploadLimit", this.uploadLimit);
} }
if (this.uploadSoftfail != null) { if (this.uploadSoftfail != null) {
holder.setInitParameter("uploadSoftfail", this.uploadSoftfail); //$NON-NLS-1$ holder.setInitParameter("uploadSoftfail", this.uploadSoftfail);
} }
if (this.debug != null) { if (this.debug != null) {
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$ holder.setInitParameter("debug", this.debug);
} }
if (protectedStaticDir != null) { if (protectedStaticDir != null) {
@ -584,7 +584,7 @@ public class ApplicationManager implements XmlRpcHandler {
@Override @Override
public String toString() { public String toString() {
return "[AppDescriptor "+this.app+"]"; //$NON-NLS-1$ //$NON-NLS-2$ return "[AppDescriptor "+this.app+"]";
} }
} }
} }

View file

@ -19,16 +19,16 @@ public class JSONModuleSource extends ModuleSource {
@Override @Override
public Reader getReader() { public Reader getReader() {
StringBuffer content = new StringBuffer(); StringBuffer content = new StringBuffer();
content.append("module.exports = "); //$NON-NLS-1$ content.append("module.exports = ");
try { try {
content.append(IOUtils.toString(this.getUri().toURL().openStream(), "UTF-8")); content.append(IOUtils.toString(this.getUri().toURL().openStream(), "UTF-8"));
} catch (IOException e) { } catch (IOException e) {
content.append("null"); //$NON-NLS-1$ content.append("null");
} }
content.append(";"); //$NON-NLS-1$ content.append(";");
return new StringReader(content.toString()); return new StringReader(content.toString());
} }

View file

@ -73,7 +73,7 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
// check if the file exists and is a file // check if the file exists and is a file
if (file.exists() && file.isFile()) { if (file.exists() && file.isFile()) {
// check if the file is a JSON file // check if the file is a JSON file
if (file.getAbsolutePath().toLowerCase().endsWith(".json")) { //$NON-NLS-1$ if (file.getAbsolutePath().toLowerCase().endsWith(".json")) {
// return a JSON module source // return a JSON module source
return new JSONModuleSource(null, file.toURI(), base, validator); return new JSONModuleSource(null, file.toURI(), base, validator);
} else { } else {
@ -83,7 +83,7 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
} }
// lets assume the module is a JS file // lets assume the module is a JS file
file = new File(new File(uri).getPath() + ".js"); //$NON-NLS-1$ file = new File(new File(uri).getPath() + ".js");
// check if a file.js exists and is a file // check if a file.js exists and is a file
if (file.exists() && file.isFile()) { if (file.exists() && file.isFile()) {
// do what would have been done anyways // do what would have been done anyways
@ -91,7 +91,7 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
} }
// lets assume the module is a JSON file // lets assume the module is a JSON file
file = new File(new File(uri).getPath() + ".json"); //$NON-NLS-1$ file = new File(new File(uri).getPath() + ".json");
// check if a file.json exists and is a file // check if a file.json exists and is a file
if (file.exists() && file.isFile()) { if (file.exists() && file.isFile()) {
// return a JSON module source // return a JSON module source
@ -135,7 +135,7 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
ModuleSource moduleSource; ModuleSource moduleSource;
// lets assume that there is a "package.json" file in the directory // lets assume that there is a "package.json" file in the directory
File packageFile = new File(directory, "package.json"); //$NON-NLS-1$ File packageFile = new File(directory, "package.json");
// check if the there is a "package.json" file in the directory // check if the there is a "package.json" file in the directory
if (packageFile.exists() && packageFile.isFile()) { if (packageFile.exists() && packageFile.isFile()) {
@ -143,9 +143,9 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
JsonObject json = JsonParser JsonObject json = JsonParser
.parseString(new String(Files.readAllBytes(packageFile.toPath()))).getAsJsonObject(); .parseString(new String(Files.readAllBytes(packageFile.toPath()))).getAsJsonObject();
// check if the JSON file defines a main JS file // check if the JSON file defines a main JS file
if (json.has("main")) { //$NON-NLS-1$ if (json.has("main")) {
// get the main JS file, removing the filename extension // get the main JS file, removing the filename extension
String main = FilenameUtils.removeExtension(json.get("main").getAsString()); //$NON-NLS-1$ String main = FilenameUtils.removeExtension(json.get("main").getAsString());
// load as file // load as file
moduleSource = this.loadAsFile(new File(directory, main).toURI(), base, validator); moduleSource = this.loadAsFile(new File(directory, main).toURI(), base, validator);
@ -158,7 +158,7 @@ public class NodeModulesProvider extends UrlModuleSourceProvider {
} }
// load as index // load as index
moduleSource = this.loadAsFile(new File(directory, "index").toURI(), base, validator); //$NON-NLS-1$ moduleSource = this.loadAsFile(new File(directory, "index").toURI(), base, validator);
// check if something was loaded // check if something was loaded
if (moduleSource != null) { if (moduleSource != null) {
// return the loaded module source // return the loaded module source

View file

@ -517,9 +517,9 @@ public abstract class AbstractServletClient extends HttpServlet {
checksum[i] = (byte) (n); checksum[i] = (byte) (n);
n >>>= 8; n >>>= 8;
} }
String etag = "\"" + new String(Base64.encodeBase64(checksum)) + "\""; //$NON-NLS-1$//$NON-NLS-2$ String etag = "\"" + new String(Base64.encodeBase64(checksum)) + "\"";
res.setHeader("ETag", etag); //$NON-NLS-1$ res.setHeader("ETag", etag);
String etagHeader = req.getHeader("If-None-Match"); //$NON-NLS-1$ String etagHeader = req.getHeader("If-None-Match");
if (etagHeader != null) { if (etagHeader != null) {
StringTokenizer st = new StringTokenizer(etagHeader, ", \r\n"); StringTokenizer st = new StringTokenizer(etagHeader, ", \r\n");
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {