Added python project; fixed spelling of folder

This commit is contained in:
2023-09-30 16:09:14 -05:00
parent 1f23cb73d1
commit 6bf66c5916
1075 changed files with 2165 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package com.itdominator.ufm.ThumbnailSystem;
// Clear file of special characters and spaces
import java.io.File;
public class CleanPath {
private static String preLine = "";
public String cleanThumbPth(String tmp) {
File f = new File(tmp);
// if it's a directory, don't remove the extention
if (f.isDirectory()) System.out.println("This is a a directory.");
String name = f.getName();
final int lastPeriodPos = name.lastIndexOf('.');
if (lastPeriodPos <= 0) {
preLine = "" + name;
} else {
// Remove the last period and everything after it
File renamed = new File(f.getParent(), name.substring(0, lastPeriodPos));
preLine = "" + renamed;
preLine = preLine.replaceAll("[^A-Za-z]+", "");
preLine = preLine.replaceAll("\\s+","");
}
return preLine;
}
}