Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script I used to rename and move photos.
import java.nio.file.Path;
import java.nio.file.Files;
public class RenamePhotos {
public static void main (String[] args) throws IOException {
try {
var dest = new"/run/secret/").toPath();
var photos = new"/run/secret/blah").listFiles();
for (var photo: photos)
Files.move( photo.toPath() , (dest.resolve("(1)"+ photo.toPath().getFileName())) );
} catch (IOException ioe) { System.out.println("Crap."); System.exit(1); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.