moved to maven project

This commit is contained in:
Hendrik Schutter 2022-05-29 16:19:39 +02:00
parent fa7a0dbbff
commit c109d82698
13 changed files with 160 additions and 12 deletions

7
.gitignore vendored
View File

@ -23,3 +23,10 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
target/
.settings/
.project
.classpath
..gitignore.kate-swp

99
pom.xml Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hendrikschutter</groupId>
<artifactId>tlc_post</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>tlc_post</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.36.0.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
<!--<release>11</release> -->
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.hendrikschutter.tlc_post.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<finalName>TLC_Post</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.hendrikschutter.tlc_post.Main</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,3 +1,4 @@
package com.hendrikschutter.tlc_post;
import java.sql.Connection;
import java.sql.DriverManager;

View File

@ -1,3 +1,5 @@
package com.hendrikschutter.tlc_post;
import java.io.File;
import java.util.Calendar;
import java.util.Date;

View File

@ -1,3 +1,4 @@
package com.hendrikschutter.tlc_post;
import com.drew.imaging.ImageMetadataReader;
import com.drew.imaging.ImageProcessingException;
@ -20,8 +21,7 @@ public class Exif
Calendar calendar = Calendar.getInstance();
try {
Metadata metadata = ImageMetadataReader.readMetadata(file);
ExifSubIFDDirectory directory = metadata
.getFirstDirectoryOfType(ExifSubIFDDirectory.class);
ExifSubIFDDirectory directory = metadata.getDirectory(ExifSubIFDDirectory.class);
date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
ZonedDateTime cetTimeZoned = ZonedDateTime.of(
new java.sql.Timestamp(date.getTime()).toLocalDateTime(),

View File

@ -1,3 +1,4 @@
package com.hendrikschutter.tlc_post;
public class Image
{

View File

@ -1,3 +1,4 @@
package com.hendrikschutter.tlc_post;
import java.nio.file.Files;
import java.nio.file.Paths;
@ -15,9 +16,12 @@ public abstract class ImageFinder
static int currentMonth = 0;
static String[] monthNames = { "01_January", "02_February", "03_March", "04_April",
"05_May", "06_June", "07_July", "08_August", "09_September",
"10_October", "11_November", "12_December" };
// static String[] monthNames = { "01_January", "02_February", "03_March",
// "04_April", "05_May", "06_June", "07_July", "08_August", "09_September",
// "10_October", "11_November", "12_December" };
static String[] monthNames = { "01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12" };
static Boolean[][] month = new Boolean[maxYears][12];
@ -32,7 +36,7 @@ public abstract class ImageFinder
String findStartyear()
{
boolean next = true;
int i = 0; // start year
int i = 2020; // start year
while (next) {
int currentyear = i;
if (Files.isDirectory(Paths.get(rootFolder + currentyear + "/"))) {

View File

@ -1,3 +1,5 @@
package com.hendrikschutter.tlc_post;
import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;

View File

@ -1,3 +1,7 @@
package com.hendrikschutter.tlc_post;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
@ -57,15 +61,15 @@ public class ImageFinderTimestamp extends ImageFinder
public String getImagePath(int imageCounter)
{
String path = null;
// System.out.println("filesindex: " + filesindex);
// System.out.println("fileslenght: " + fileslenght);
System.out.println("filesindex: " + filesindex);
System.out.println("fileslenght: " + fileslenght);
if ((filesindex < fileslenght) && (fileslenght != 0)) {
path = files[filesindex].getAbsolutePath();
filesindex++;
return path.substring(lengthRootFolder);
} else {
// System.out.println("sort new Images");
System.out.println("sort new Images");
sortImages();
if (filesindex >= fileslenght) {

View File

@ -1,10 +1,10 @@
package com.hendrikschutter.tlc_post;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Calendar;
public class Main
{
// read from UI later
@ -123,6 +123,8 @@ public class Main
String startyear = imgF.findStartyear();
int yearCount = Integer.parseInt(startyear);
System.out.println(yearCount);
imgF.findYears(yearCount, startyear);
imgF.findMonths(yearCount);
@ -149,7 +151,7 @@ public class Main
System.out.println("%");
}
String path = imgF.getImagePath(i);
// System.out.println(i + " Path: " + path);
System.out.println(i + " Path: " + path);
if (path != "404") {
// gefunden
File f = new File(rootFolderPath + path);
@ -172,6 +174,8 @@ public class Main
// nicht gefunden
System.out.println("Nicht gefunden: " + i);
missingTxt.println(i);
break;
}
}
missingTxt.close();

View File

@ -1,3 +1,5 @@
package com.hendrikschutter.tlc_post;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

View File

@ -1,3 +1,5 @@
package com.hendrikschutter.tlc_post;
import java.util.Calendar;
import java.util.List;

View File

@ -0,0 +1,20 @@
package com.hendrikschutter.tlc_post;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}