Code example for JarEntry

Methods: setTime

0
    private static JarOutputStream jarOut;
    private static long time;
 
    private static void process(File file) throws IOException{
        String name = file.getName().replaceAll("[\\/\\.]", "_");
        JarEntry entry = new JarEntry(name);
        entry.setTime(time);
 
        jarOut.putNextEntry(entry);
    } 
 
    public static void main(String[] args) throws IOException{
        if (args.length == 0){
            System.out.println("Usage: java -jar FolderConverter <input folder>");
            System.out.println();
            System.out.println("  Converts files from input to output");
            System.exit(1);
        } 
 
        sourceRoot = new File(args[0]);