public static String formatDate(Date date) { return formatDate(date, false); }
public static String formatDate(Date date) { return formatDate(date, false); }
public static String formatDate(Date date) { return formatDate(date, false); }
public String getPropertyTime(String name) { String path = getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work"; File file = getAdminFile(path); return SVNDate.formatDate(new Date(file.lastModified())); }
public String getPropertyTime(String name) { String path = getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work"; File file = getAdminFile(path); return SVNDate.formatDate(new Date(file.lastModified())); }
public String getPropertyTime(String name) { String path = getThisDirName().equals(name) ? "dir-props" : "props/" + name + ".svn-work"; File file = getAdminFile(path); return SVNDate.formatDate(new Date(SVNFileUtil.getFileLastModified(file))); }
public static StringBuffer generateDateRevisionRequest(StringBuffer xmlBuffer, Date date) { xmlBuffer = xmlBuffer == null ? new StringBuffer() : xmlBuffer; SVNXMLUtil.addXMLHeader(xmlBuffer); SVNXMLUtil.openNamespaceDeclarationTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", SVN_DAV_NAMESPACES_LIST, SVNXMLUtil.PREFIX_MAP, xmlBuffer); SVNXMLUtil.openCDataTag(SVNXMLUtil.DAV_NAMESPACE_PREFIX, "creationdate", SVNDate.formatDate(date), xmlBuffer); SVNXMLUtil.addXMLFooter(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", xmlBuffer); return xmlBuffer; }
public static StringBuffer generateDateRevisionRequest(StringBuffer xmlBuffer, Date date) { xmlBuffer = xmlBuffer == null ? new StringBuffer() : xmlBuffer; SVNXMLUtil.addXMLHeader(xmlBuffer); SVNXMLUtil.openNamespaceDeclarationTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", SVN_DAV_NAMESPACES_LIST, SVNXMLUtil.PREFIX_MAP, xmlBuffer); SVNXMLUtil.openCDataTag(SVNXMLUtil.DAV_NAMESPACE_PREFIX, "creationdate", SVNDate.formatDate(date), xmlBuffer); SVNXMLUtil.addXMLFooter(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", xmlBuffer); return xmlBuffer; }
public static StringBuffer generateDateRevisionRequest(StringBuffer xmlBuffer, Date date) { xmlBuffer = xmlBuffer == null ? new StringBuffer() : xmlBuffer; SVNXMLUtil.addXMLHeader(xmlBuffer); SVNXMLUtil.openNamespaceDeclarationTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", SVN_DAV_NAMESPACES_LIST, SVNXMLUtil.PREFIX_MAP, xmlBuffer); SVNXMLUtil.openCDataTag(SVNXMLUtil.DAV_NAMESPACE_PREFIX, "creationdate", SVNDate.formatDate(date), xmlBuffer); SVNXMLUtil.addXMLFooter(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dated-rev-report", xmlBuffer); return xmlBuffer; }
public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } return txn; }
public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } return txn; }
public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } return txn; }
private void handlePropTime(SVNLog log, SVNEntry entry) throws SVNException { if (getFormatVersion() == SVNXMLAdminAreaFactory.WC_FORMAT) { return; } SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, entry.getName()); command.put(SVNProperty.shortPropertyName(SVNProperty.PROP_TIME), SVNDate.formatDate(new Date(0), true)); log.addCommand(SVNLog.MODIFY_ENTRY, command, false); }
private void handlePropTime(SVNLog log, SVNEntry entry) throws SVNException { if (getFormatVersion() == SVNXMLAdminAreaFactory.WC_FORMAT) { return; } SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, entry.getName()); command.put(SVNProperty.shortPropertyName(SVNProperty.PROP_TIME), SVNDate.formatDate(new Date(0), true)); log.addCommand(SVNLog.MODIFY_ENTRY, command, false); }
private void handlePropTime(SVNLog log, SVNEntry entry) throws SVNException { if (getFormatVersion() == SVNXMLAdminAreaFactory.WC_FORMAT) { return; } SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, entry.getName()); command.put(SVNProperty.shortPropertyName(SVNProperty.PROP_TIME), SVNDate.formatDate(new Date(0), true)); log.addCommand(SVNLog.MODIFY_ENTRY, command, false); }
private String formatRevisionString(String revisionPrefix, SVNRevision revision) { if (revision == null) { return null; } else if (revision == SVNRevision.HEAD) { return revisionPrefix + "HEAD"; } else if (revision.getDate() != null) { return revisionPrefix + "{" + SVNDate.formatDate(revision.getDate(), true) + "}"; } else if (SVNRevision.isValidRevisionNumber(revision.getNumber())) { return revisionPrefix + revision.getNumber(); } else { return null; } }
private CommitInfo getCommitInfo(SVNCommitInfo commitInfo, SVNURL repositoryRoot) throws ParseException { return new CommitInfo(commitInfo.getNewRevision(), SVNDate.formatDate(commitInfo.getDate()), commitInfo.getAuthor(), getErrorMessageString(commitInfo.getErrorMessage()), getUrlString(repositoryRoot)); }
public DAVLock findLock(DAVResource resource, String lockToken) throws DAVException { //TODO: add here authz check later DAVLock davLock = null; FSLock lock = null; try { lock = (FSLock) resource.getLock(); } catch (SVNException svne) { throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to look up lock by path.", null); } if (lock != null) { if (!lockToken.equals(lock.getID())) { throw new DAVException("Incoming token doesn't match existing lock.", HttpServletResponse.SC_BAD_REQUEST, DAVErrorCode.LOCK_SAVE_LOCK); } davLock = convertSVNLockToDAVLock(lock, false, resource.exists()); myOwner.setResponseHeader(HTTPHeader.CREATION_DATE_HEADER, SVNDate.formatDate(lock.getCreationDate())); myOwner.setResponseHeader(HTTPHeader.LOCK_OWNER_HEADER, lock.getOwner()); } return davLock; }
public DAVLock getLock(DAVResource resource) throws DAVException { if (resource.getResourceURI().getPath() == null) { return null; } if (DAVHandlerFactory.METHOD_LOCK.equals(myOwner.getRequestMethod())) { return null; } //TODO: add authz check here later DAVLock davLock = null; FSLock lock = null; try { lock = (FSLock) resource.getLock(); } catch (SVNException svne) { throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to check path for a lock.", null); } if (lock != null) { davLock = convertSVNLockToDAVLock(lock, myIsBreakLock, resource.exists()); myOwner.setResponseHeader(HTTPHeader.CREATION_DATE_HEADER, SVNDate.formatDate(lock.getCreationDate())); myOwner.setResponseHeader(HTTPHeader.LOCK_OWNER_HEADER, lock.getOwner()); } return davLock; }
public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { SVNURL fullURL = rootURL.appendPath(path, false); LockInfo lockInfo = (LockInfo) entriesMap.get(fullURL); SVNAdminArea dir = wcAccess.probeRetrieve(lockInfo.myFile); if (error == null) { SVNEntry entry = wcAccess.getVersionedEntry(lockInfo.myFile, false); entry.setLockToken(lock.getID()); entry.setLockComment(lock.getComment()); entry.setLockOwner(lock.getOwner()); entry.setLockCreationDate(SVNDate.formatDate(lock.getCreationDate())); // get properties and values. SVNVersionedProperties props = dir.getProperties(entry.getName()); if (props.getPropertyValue(SVNProperty.NEEDS_LOCK) != null) { SVNFileUtil.setReadonly(dir.getFile(entry.getName()), false); } SVNFileUtil.setExecutable(dir.getFile(entry.getName()), props.getPropertyValue(SVNProperty.EXECUTABLE) != null); dir.saveEntries(false); handleEvent(SVNEventFactory.createLockEvent(dir.getFile(entry.getName()), SVNEventAction.LOCKED, lock, null), ISVNEventHandler.UNKNOWN); } else { handleEvent(SVNEventFactory.createLockEvent(dir.getFile(lockInfo.myFile.getName()), SVNEventAction.LOCK_FAILED, lock, error), ISVNEventHandler.UNKNOWN); } }