comparison src/org/tmatesoft/hg/util/Path.java @ 148:1a7a9a20e1f9

Exceptions, javadoc. Initial cancel and progress support
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 23 Feb 2011 22:36:28 +0100
parents 8248aae33f7d
children 1ec6b327a6ac
comparison
equal deleted inserted replaced
147:a05145db4d0c 148:1a7a9a20e1f9
27 // private int flags; // dir, unparsed 27 // private int flags; // dir, unparsed
28 private String path; 28 private String path;
29 29
30 /*package-local*/Path(String p) { 30 /*package-local*/Path(String p) {
31 path = p; 31 path = p;
32 }
33
34 /**
35 * Check if this is directory's path.
36 * Note, this method doesn't perform any file system operation.
37 *
38 * @return true when this path points to a directory
39 */
40 public boolean isDirectory() {
41 // XXX simple logic for now. Later we may decide to have an explicit factory method to create directory paths
42 return path.charAt(path.length() - 1) == '/';
32 } 43 }
33 44
34 public int length() { 45 public int length() {
35 return path.length(); 46 return path.length();
36 } 47 }