private static boolean isVersionedFile(File file) { SVNWCAccess wcAccess = SVNWCAccess.newInstance(null); try { SVNAdminArea area = wcAccess.probeOpen(file, false, 0); if (area.getEntry(area.getThisDirName(), false) == null) { return false; } SVNFileType type = SVNFileType.getType(file); if (type.isFile() || type == SVNFileType.NONE) { return area.getEntry(file.getName(), false) != null; } else if (type != SVNFileType.NONE && !area.getRoot().equals(file)) { return false; } return true; } catch (SVNException e) { return false; } finally { try { wcAccess.close(); } catch (SVNException svne) { } } } }
private static boolean isVersionedFile(File file) { SVNWCAccess wcAccess = SVNWCAccess.newInstance(null); try { SVNAdminArea area = wcAccess.probeOpen(file, false, 0); if (area.getEntry(area.getThisDirName(), false) == null) { return false; } SVNFileType type = SVNFileType.getType(file); if (type.isFile() || type == SVNFileType.NONE) { // file or missing file return area.getEntry(file.getName(), false) != null; } else if (type != SVNFileType.NONE && !area.getRoot().equals(file)) { // directory, but not anchor. always considered unversioned. return false; } return true; } catch (SVNException e) { return false; } finally { try { wcAccess.close(); } catch (SVNException svne) { // } } }
private static boolean isVersionedFile(File file) { SVNWCAccess wcAccess = SVNWCAccess.newInstance(null); try { SVNAdminArea area = wcAccess.probeOpen(file, false, 0); if (area.getEntry(area.getThisDirName(), false) == null) { return false; } SVNFileType type = SVNFileType.getType(file); if (type.isFile() || type == SVNFileType.NONE) { // file or missing file return area.getEntry(file.getName(), false) != null; } else if (type != SVNFileType.NONE && !area.getRoot().equals(file)) { // directory, but not anchor. always considered unversioned. return false; } return true; } catch (SVNException e) { return false; } finally { try { wcAccess.close(); } catch (SVNException svne) { // } } }
private static boolean isVersionedFile(File file) { SVNWCAccess wcAccess = SVNWCAccess.newInstance(null); try { SVNAdminArea area = wcAccess.probeOpen(file, false, 0); if (area.getEntry(area.getThisDirName(), false) == null) { return false; } SVNFileType type = SVNFileType.getType(file); if (type.isFile() || type == SVNFileType.NONE) { // file or missing file return area.getEntry(file.getName(), false) != null; } else if (type != SVNFileType.NONE && !area.getRoot().equals(file)) { // directory, but not anchor. always considered unversioned. return false; } return true; } catch (SVNException e) { return false; } finally { try { wcAccess.close(); } catch (SVNException svne) { // } } }
public void runOperation(SVNWCContext ctx, File wcRootAbspath, SVNSkel workItem) throws NumberFormatException, SVNException { File localAbspath = SVNFileUtil.createFilePath(wcRootAbspath, workItem.getChild(1).getValue()); SVNDate setTime = null; if (workItem.getListSize() > 2) { long val = Long.parseLong(workItem.getChild(2).getValue()); setTime = SVNWCUtils.readDate(val); } if (setTime != null) { if (SVNFileType.getType(localAbspath).isFile()) { SVNFileUtil.setFileLastModifiedMicros(localAbspath, setTime.getTimeInMicros()); } } ctx.getAndRecordFileInfo(localAbspath, true); } }