Mercurial Hosting > luan
diff src/luan/lib/Utils.java @ 161:d310ebf4d6e7
add javaSearcher
git-svn-id: https://luan-java.googlecode.com/svn/trunk@162 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 19 Jun 2014 10:44:20 +0000 |
parents | fcb81fa2df0d |
children |
line wrap: on
line diff
--- a/src/luan/lib/Utils.java Thu Jun 19 07:02:16 2014 +0000 +++ b/src/luan/lib/Utils.java Thu Jun 19 10:44:20 2014 +0000 @@ -52,8 +52,16 @@ return out.toByteArray(); } + public static boolean exists(File file) { + try { + return file.exists() && file.getName().equals(file.getCanonicalFile().getName()); + } catch(IOException e) { + throw new RuntimeException(e); + } + } + public static boolean isFile(String path) { - return new File(path).exists(); + return exists(new File(path)); } public static String toUrl(String path) {