A tool for organizing photos and videos into my personal favorite layout.
Before you begin: Ensure that you have jdk 17 and mvn 3.x.x.
Create a properties file with the following content:
# # Mandatory properties (otherwise the application will not start) # mediaorganizer.fileSystemType=local mediaorganizer.source.fromDir=/test_media_organizer/input mediaorganizer.destination.toDir=/test_media_organizer/output # # Optional properties (here configuring the application to use Danish locale and texts) # mediaorganizer.destination.localeForGeneratingDestinationFolderNames=da mediaorganizer.destination.suffixForDestinationFolderOfMiscMediaFiles=Blandet mediaorganizer.destination.suffixForDestinationFolderOfUnknownEventMediaFiles=Ukendt Haendelse
See app/src/main/resources/application.yml for more properties that you can override (for example supported media files etc).
Then run the application with the following command mvn spring-boot:run
Do you want to try out the tool with Dropbox? Then set properties: mediaorganizer.fileSystemType=dropbox
and dropbox.accessToken=[your-own-token]
. To use this feature you need to get your own token for your Dropbox account.
Do you want to try out the tool with support for loading properties from AWS SSM Parameter store? Then set property:
aws.paramstore.enabled=true
(enables the code to load properties from AWS SSM Parameter store) and the usual
AWS SDK specific environment variables:
-
AWS_REGION=blah
,AWS_ACCESS_KEY_ID=secret
andAWS_SECRET_KEY=secret
(and possiblyAWS_SESSION_TOKEN=secret
if you are using temporary credentials - and you should) -
Or, if you have proper profiles defined, then:
AWS_PROFILE=blah
-
The code also respects
AWS_CREDENTIAL_PROFILES_FILE
which can be used to point to a custom location of your AWS credentials file -
etc. etc.
Now you can set properties in AWS SSM Parameter store under /APPLICATION/MEDIA-ORGANIZER/*
and the application will
load them (consider to put the Dropbox access token in AWS SSM Parameter store as an encrypted value for example).
All examples are meant to be run from a POSIX terminal positioned at the app directory.
Also note: the application is run with overriding properties from properties file etc/application-production.properties
. That
file enables AWS SSM Parameter store and loads properties from there. Therefore you must have exported the AWS SDK specific environment variables
mentioned above.
Maven:
SPRING_PROFILES_ACTIVE=production mvn spring-boot:run
JRE (it’s a shaded JAR, not a spring boot plugin built one):
SPRING_PROFILES_ACTIVE=production java -cp target/media-organizer-0.0.1-SNAPSHOT.jar com.moelholm.tools.mediaorganizer.Main