source: other-projects/trunk/gs3-release-maker/tasks/antelope/src/ise/antelope/tasks/typedefs/file/LastModified.java@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 840 bytes
Line 
1package ise.antelope.tasks.typedefs.file;
2
3import java.io.*;
4import java.text.SimpleDateFormat;
5import java.util.Date;
6
7/**
8 * Copyright 2003
9 *
10 * @version $Revision: 1.1 $
11 */
12public class LastModified implements FileOp {
13
14 private String format = null;
15
16 public void setFormat(String f) {
17 format = f;
18 }
19
20 /**
21 * Checks if the given file is writable
22 *
23 * @param f a file
24 * @return true if the file is a writable.
25 */
26 public String execute(File f) {
27 if (f == null)
28 throw new IllegalArgumentException("file cannot be null");
29 Date date = new Date(f.lastModified());
30 String lm;
31 if (format != null)
32 lm = new SimpleDateFormat(format).format(date);
33 else
34 lm = date.toString();
35 return lm;
36 }
37}
38
39
Note: See TracBrowser for help on using the repository browser.