Below code is working properly in eclipse. But I,m trying to create this source in oracle 11g Db. While creating it throws some warnings.
create or replace
and compile java source named "Noitime"
as
package com;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
public class Noitime {
public String attr(String filepath,String filename)
{
long time = System.currentTimeMillis();
FileTime fileTime = FileTime.fromMillis(time);
Path path = Paths.get(filepath,filename);
try {
Files.setLastModifiedTime(path, fileTime);
return "Success";
} catch (IOException e) {
System.err.println(e);
return "Fail";
}
}
}