Line | |
---|
1 | package ise.antelope.tasks.typedefs.file;
|
---|
2 |
|
---|
3 | import java.io.*;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Copyright 2003
|
---|
7 | *
|
---|
8 | * @version $Revision: 1.1 $
|
---|
9 | */
|
---|
10 | public class CanRead implements FileOp {
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Checks if the given file is readable
|
---|
14 | *
|
---|
15 | * @param f a file
|
---|
16 | * @return true if the file is a readable.
|
---|
17 | */
|
---|
18 | public String execute(File f) {
|
---|
19 | if (f == null)
|
---|
20 | throw new IllegalArgumentException("file cannot be null");
|
---|
21 | return f.canRead() ? "true" : "false";
|
---|
22 | }
|
---|
23 | }
|
---|
24 |
|
---|
25 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.