Package org.syncany.database.PartialFileHistory

Examples of org.syncany.database.PartialFileHistory.FileHistoryId


   */
  public void removeFileVersions(Map<FileHistoryId, FileVersion> purgeFileVersions) throws SQLException {
    if (purgeFileVersions.size() > 0) {
      try (PreparedStatement preparedStatement = getStatement(connection, "fileversion.delete.all.removeFileVersionsByIds.sql")) {
        for (Map.Entry<FileHistoryId, FileVersion> purgeFileVersionEntry : purgeFileVersions.entrySet()) {
          FileHistoryId purgeFileHistoryId = purgeFileVersionEntry.getKey();
          FileVersion purgeFileVersion = purgeFileVersionEntry.getValue();
         
          preparedStatement.setString(1, purgeFileHistoryId.toString());
          preparedStatement.setLong(2, purgeFileVersion.getVersion());
         
          preparedStatement.addBatch();
        }       
       
View Full Code Here


  private Map<FileHistoryId, FileVersion> getSingleVersionInHistory(PreparedStatement preparedStatement) throws SQLException {
    try (ResultSet resultSet = preparedStatement.executeQuery()) {
      Map<FileHistoryId, FileVersion> mostRecentPurgeFileVersions = new HashMap<FileHistoryId, FileVersion>();
     
      while (resultSet.next()) {
        FileHistoryId fileHistoryId = FileHistoryId.parseFileId(resultSet.getString("filehistory_id"));
        FileVersion fileVersion = createFileVersionFromRow(resultSet);
       
        mostRecentPurgeFileVersions.put(fileHistoryId, fileVersion);
      }  
     
View Full Code Here

   
    if (nonOptionArgs.size() != 1) {
      throw new Exception("Invalid Syntax: File history ID must be specified.");
    }
       
    FileHistoryId restoreFileHistory = FileHistoryId.parseFileId(nonOptionArgs.get(0).toString());
    operationOptions.setFileHistoryId(restoreFileHistory)
   
    return operationOptions;
  }
View Full Code Here

TOP

Related Classes of org.syncany.database.PartialFileHistory.FileHistoryId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.