/** * Determines the sticky information for a given file. If the file is new then it returns its * parent directory's sticky info, if any. * * @param file file to examine * @return String sticky information for a file (without leading N, D or T specifier) or null */ public static String getSticky(File file) { if (file == null) return null; FileInformation info = CvsVersioningSystem.getInstance().getStatusCache().getStatus(file); if (info.getStatus() == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY) { return getSticky(file.getParentFile()); } else if (info.getStatus() == FileInformation.STATUS_NOTVERSIONED_EXCLUDED) { return null; } if (file.isDirectory()) { String std = CvsVersioningSystem.getInstance().getAdminHandler().getStickyTagForDirectory(file); if (std != null) { std = std.substring(1); } return std; } Entry entry = info.getEntry(file); if (entry != null) { String stickyInfo = null; if (entry.getTag() != null) stickyInfo = entry.getTag(); // NOI18N else if (entry.getDate() != null) stickyInfo = entry.getDateFormatted(); // NOI18N return stickyInfo; } return null; }