01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.internal.io.fs;
13:
14: /**
15: * @version 1.1.1
16: * @author TMate Software Ltd.
17: */
18: public class PathInfo {
19:
20: String myPath;
21: String myLinkPath;
22: String myLockToken;
23: long myRevision;
24: boolean startEmpty;
25:
26: public PathInfo(String path, String linkPath, String lockToken,
27: long revision, boolean empty) {
28: myPath = path;
29: myLinkPath = linkPath;
30: myLockToken = lockToken;
31: myRevision = revision;
32: startEmpty = empty;
33: }
34:
35: public String getLinkPath() {
36: return myLinkPath;
37: }
38:
39: public String getLockToken() {
40: return myLockToken;
41: }
42:
43: public String getPath() {
44: return myPath;
45: }
46:
47: public long getRevision() {
48: return myRevision;
49: }
50:
51: public boolean isStartEmpty() {
52: return startEmpty;
53: }
54:
55: public static boolean isRelevant(PathInfo pathInfo, String prefix) {
56: /* Return true if pathInfo's path is a child of prefix. */
57: return pathInfo != null
58: && pathInfo.getPath().startsWith(prefix)
59: && ("".equals(prefix) || pathInfo.getPath().charAt(
60: prefix.length()) == '/');
61: }
62:
63: }
|