Examples of IFileRangeSpecification


Examples of org.eclipse.ecf.filetransfer.IFileRangeSpecification

        }
      }
    };

    final IFileID fileID = FileIDFactory.getDefault().createFileID(transferInstance.getRetrieveNamespace(), url);
    IFileRangeSpecification rangeSpecification = null;
    if (start != -1) {
      rangeSpecification = new IFileRangeSpecification() {
        public long getEndPosition() {
          return end;
        }

        public long getStartPosition() {
View Full Code Here

Examples of org.eclipse.ecf.filetransfer.IFileRangeSpecification

      }
    }
  }

  protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException {
    final IFileRangeSpecification rangeSpec = getFileRangeSpecification();
    if (rangeSpec != null && isHTTP()) {
      final long startPosition = rangeSpec.getStartPosition();
      final long endPosition = rangeSpec.getEndPosition();
      if (startPosition < 0)
        throw new InvalidFileRangeSpecificationException(Messages.UrlConnectionRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO, rangeSpec);
      if (endPosition != -1L && endPosition <= startPosition)
        throw new InvalidFileRangeSpecificationException(Messages.UrlConnectionRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START, rangeSpec);
      setRangeHeader("bytes=" + startPosition + "-" + ((endPosition == -1L) ? "" : ("" + endPosition))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
View Full Code Here

Examples of org.eclipse.ecf.filetransfer.IFileRangeSpecification

      httpClient.getCredentialsProvider().setCredentials(authScope, credentials);
    }
  }

  protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException {
    final IFileRangeSpecification rangeSpec = getFileRangeSpecification();
    if (rangeSpec != null) {
      final long startPosition = rangeSpec.getStartPosition();
      final long endPosition = rangeSpec.getEndPosition();
      if (startPosition < 0)
        throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO, rangeSpec);
      if (endPosition != -1L && endPosition <= startPosition)
        throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START, rangeSpec);
      String rangeHeader = "bytes=" + startPosition + "-" + ((endPosition == -1L) ? "" : ("" + endPosition)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
View Full Code Here

Examples of org.eclipse.ecf.filetransfer.IFileRangeSpecification

    getHostConfiguration(); // creates hostConfigHelper if needed
    hostConfigHelper.setTargetHostByURL(credProvider, urlString);
  }

  protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException {
    final IFileRangeSpecification rangeSpec = getFileRangeSpecification();
    if (rangeSpec != null) {
      final long startPosition = rangeSpec.getStartPosition();
      final long endPosition = rangeSpec.getEndPosition();
      if (startPosition < 0)
        throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO, rangeSpec);
      if (endPosition != -1L && endPosition <= startPosition)
        throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START, rangeSpec);
      String rangeHeader = "bytes=" + startPosition + "-" + ((endPosition == -1L) ? "" : ("" + endPosition)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.