Auflösen von Pfaden verbessert
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Maven: de.srsoftware:tools:1.1.18" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: de.srsoftware:tools.translations:1.1.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: de.srsoftware:tools.gui.selectcombobox:0.1.9" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.json:json:20200518" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.2.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-viewer:6.2.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-awt-util:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-dom:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-svg-dom:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-svggen:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-util:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: batik:batik-xml:1.6" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>BelegScanner</groupId>
|
<groupId>BelegScanner</groupId>
|
||||||
<artifactId>BelegScanner</artifactId>
|
<artifactId>BelegScanner</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>1.1.2</version>
|
||||||
|
|
||||||
<name>BelegScanner</name>
|
<name>BelegScanner</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|||||||
@@ -86,32 +86,41 @@ public class Worker {
|
|||||||
int year = 1900+date.getYear();
|
int year = 1900+date.getYear();
|
||||||
int month = date.getMonth()+1;
|
int month = date.getMonth()+1;
|
||||||
int day = date.getDate();
|
int day = date.getDate();
|
||||||
resolvedPath = rawPath.replace("$"+t("HOME"),HOME)
|
|
||||||
.replace("$"+t("PROFILE"), profile)
|
|
||||||
.replace("$"+t("YEAR"), year+"")
|
|
||||||
.replace("$"+t("MONTH"), month<10 ? "0"+month : ""+month)
|
|
||||||
.replace("$"+t("Month"),monthName(month))
|
|
||||||
.replace("$"+t("month"),monthName(month).toLowerCase())
|
|
||||||
.replace("$"+t("Mon"),monthNameShort(month))
|
|
||||||
.replace("$"+t("mon"),monthNameShort(month).toLowerCase())
|
|
||||||
.replace("$"+t("DAY"), day < 10 ? "0"+day : ""+day);
|
|
||||||
|
|
||||||
var start = resolvedPath.indexOf("$");
|
|
||||||
toolbar.resetAdditionalFields();
|
toolbar.resetAdditionalFields();
|
||||||
while (start>-1) {
|
resolvedPath = rawPath;
|
||||||
var end = endOfVar(resolvedPath, start+1);
|
var last = "";
|
||||||
if (end>start+1){
|
var iter = 0;
|
||||||
var variable = resolvedPath.substring(start+1, end);
|
do {
|
||||||
LOG.debug("…unresolved '{}'",variable);
|
last = resolvedPath;
|
||||||
var value = PAGE.equals(variable) ? "["+variable+"]":toolbar.requireField(variable);
|
LOG.debug("Starting iteration {}: {}",++iter,resolvedPath);
|
||||||
variable = "$"+variable;
|
resolvedPath = resolvedPath.replace("$" + t("HOME"), HOME)
|
||||||
LOG.debug("replacing '{}' in '{}' by '{}'",variable,resolvedPath,value);
|
.replace("$" + t("PROFILE"), profile)
|
||||||
resolvedPath = resolvedPath.replace(variable,value);
|
.replace("$" + t("YEAR"), year + "")
|
||||||
start = resolvedPath.indexOf("$",start+1);
|
.replace("$" + t("MONTH"), month < 10 ? "0" + month : "" + month)
|
||||||
} else {
|
.replace("$" + t("Month"), monthName(month))
|
||||||
start = resolvedPath.indexOf("$",start+2);
|
.replace("$" + t("month"), monthName(month).toLowerCase())
|
||||||
|
.replace("$" + t("Mon"), monthNameShort(month))
|
||||||
|
.replace("$" + t("mon"), monthNameShort(month).toLowerCase())
|
||||||
|
.replace("$" + t("DAY"), day < 10 ? "0" + day : "" + day);
|
||||||
|
|
||||||
|
var start = resolvedPath.indexOf("$");
|
||||||
|
if (start > -1) {
|
||||||
|
var end = endOfVar(resolvedPath, start + 1);
|
||||||
|
if (end > start + 1) {
|
||||||
|
var variable = resolvedPath.substring(start + 1, end);
|
||||||
|
LOG.debug("…unresolved '{}'", variable);
|
||||||
|
var value = PAGE.equals(variable) ? "[" + variable + "]" : toolbar.requireField(variable);
|
||||||
|
variable = "$" + variable;
|
||||||
|
LOG.debug("replacing '{}' in '{}' by '{}'", variable, resolvedPath, value);
|
||||||
|
resolvedPath = resolvedPath.replace(variable, value);
|
||||||
|
start = resolvedPath.indexOf("$", start + 1);
|
||||||
|
} else {
|
||||||
|
start = resolvedPath.indexOf("$", start + 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
LOG.debug("Iteration {} ended: {}",iter,resolvedPath);
|
||||||
|
} while (!last.equals(resolvedPath));
|
||||||
|
LOG.debug("result: {}",resolvedPath);
|
||||||
toolbar.dropUnusedAdditionalFields();
|
toolbar.dropUnusedAdditionalFields();
|
||||||
statusBar.setPath(resolvedPath+"."+extension());
|
statusBar.setPath(resolvedPath+"."+extension());
|
||||||
mainFrame.pack();
|
mainFrame.pack();
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
|
<logger name="de.srsoftware.belegscanner.Worker" level="debug" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
<root level="error">
|
<root level="error">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ January : Januar
|
|||||||
Joining PDFs… : Verbinde PDFs…
|
Joining PDFs… : Verbinde PDFs…
|
||||||
join PDFs : PDFs binden
|
join PDFs : PDFs binden
|
||||||
July : Juli
|
July : Juli
|
||||||
|
June : Juni
|
||||||
Language support : Sprach-Unterstützung
|
Language support : Sprach-Unterstützung
|
||||||
May : Mai
|
May : Mai
|
||||||
March : März
|
March : März
|
||||||
|
|||||||
Reference in New Issue
Block a user