added DateModified
This commit is contained in:
parent
0d4c2825f6
commit
d0f3933574
|
@ -0,0 +1,25 @@
|
|||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class DateModified
|
||||
{
|
||||
public Calendar getDate(String filepath)
|
||||
{
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
// Specify the file path and name
|
||||
File file = new File(filepath);
|
||||
|
||||
long lastModified = file.lastModified();
|
||||
Date date = new Date(lastModified);
|
||||
|
||||
System.out.println(date);
|
||||
|
||||
calendar.setTime(date);
|
||||
|
||||
return calendar;
|
||||
|
||||
}
|
||||
}
|
|
@ -102,6 +102,7 @@ public class Main
|
|||
|
||||
DBController db = new DBController(projectPath);
|
||||
Exif exif = new Exif();
|
||||
DateModified datemod = new DateModified();
|
||||
|
||||
db.connectDatabase();
|
||||
db.createTableImages();
|
||||
|
@ -140,7 +141,9 @@ public class Main
|
|||
// gefunden
|
||||
File f = new File(rootFolderPath + path);
|
||||
int size = (int) f.length();
|
||||
Calendar calendar = exif.getDate(rootFolderPath + path);
|
||||
// Calendar calendar = exif.getDate(rootFolderPath + path);
|
||||
|
||||
Calendar calendar = datemod.getDate(rootFolderPath + path);
|
||||
|
||||
db.fillImages(i, path, calendar.get(Calendar.DAY_OF_MONTH),
|
||||
(calendar.get(Calendar.MONTH) + 1),
|
||||
|
|
Loading…
Reference in New Issue