Package org.syncany.plugins.transfer

Examples of org.syncany.plugins.transfer.StorageException


  }

  @Override
  protected String validateName(String name) throws StorageException {
    if (!NAME_FORMAT.equals(name)) {
      throw new StorageException(name + ": remote filename pattern does not match: " + NAME_FORMAT + " expected.");
    }

    return name;
  }
View Full Code Here


  @Override
  protected String validateName(String name) throws StorageException {
    Matcher matcher = NAME_PATTERN.matcher(name);

    if (!matcher.matches()) {
      throw new StorageException(name + ": remote filename pattern does not match: " + NAME_PATTERN.pattern() + " expected.");
    }

    try {
      multiChunkId = StringUtil.fromHex(matcher.group(1));
    }
    catch (Exception e) {
      throw new StorageException(name + ": remote filename pattern does not match (invalid hex): " + NAME_PATTERN.pattern() + " expected.");
    }

    return name;
  }
View Full Code Here

  public static <T extends RemoteFile> T createRemoteFile(String name, Class<T> remoteFileClass) throws StorageException {
    try {
      return remoteFileClass.getConstructor(String.class).newInstance(name);
    }
    catch (Exception e) {
      throw new StorageException(e);
    }
  }
View Full Code Here

      Class<T> remoteFileClass = (Class<T>) Class.forName(REMOTE_FILE_PACKAGE + "." + camelCasePrefix + REMOTE_FILE_SUFFIX);
      return createRemoteFile(name, remoteFileClass);
    }
    catch (ClassNotFoundException| StorageException e) {
      logger.log(Level.INFO, "Invalid filename for remote file " + name);
      throw new StorageException("Invalid filename for remote file " + name);
    }   
  }
View Full Code Here

  @Override
  protected String validateName(String name) throws StorageException {
    Matcher matcher = NAME_PATTERN.matcher(name);

    if (!matcher.matches()) {
      throw new StorageException(name + ": remote database filename pattern does not match: " + NAME_PATTERN.pattern() + " expected.");
    }

    operationName = matcher.group(1);
    clientName = matcher.group(2);
    timestamp = Long.parseLong(matcher.group(3));
View Full Code Here

TOP

Related Classes of org.syncany.plugins.transfer.StorageException

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.