Tabnine Logo
ChunkedFileUploadRemoteOperation
Code IndexAdd Tabnine to your IDE (free)

How to use
ChunkedFileUploadRemoteOperation
in
com.owncloud.android.lib.resources.files

Best Java code snippets using com.owncloud.android.lib.resources.files.ChunkedFileUploadRemoteOperation (Showing top 4 results out of 315)

origin: nextcloud/android-library

  private boolean test(List<Chunk> existingChunks, List<Chunk> expectedMissingChunks, long chunkSize, long length) {
    ChunkedFileUploadRemoteOperation sut = new ChunkedFileUploadRemoteOperation(null, null, null, null, null, null,
                                          false);

    List<Chunk> missingChunks = sut.checkMissingChunks(existingChunks, length, chunkSize);

    assertEquals(expectedMissingChunks.size(), missingChunks.size());

    for (Chunk expectedMissingChunk : expectedMissingChunks) {
      assertTrue(missingChunks.contains(expectedMissingChunk));
    }

    return true;
  }
}
origin: nextcloud/android-library

List<Chunk> checkMissingChunks(List<Chunk> chunks, long length, long chunkSize) {
  List<Chunk> missingChunks = new ArrayList<>();
  long start = 0;
  while (start <= length) {
    Chunk nextChunk = findNextFittingChunk(chunks, start, chunkSize);
    if (nextChunk == null) {
      // create new chunk
      long end;
      if (start + chunkSize <= length) {
        end = start + chunkSize - 1;
      } else {
        end = length;
      }
      missingChunks.add(new Chunk(start, end));
      start = end + 1;
    } else if (nextChunk.start == start) {
      // go to next
      start = start + nextChunk.length();
    } else {
      // fill the gap
      missingChunks.add(new Chunk(start, nextChunk.start - 1));
      start = nextChunk.start;
    }
  }
  return missingChunks;
}
origin: nextcloud/android-library

  List<Chunk> missingChunks = checkMissingChunks(chunksOnServer, file.length(), chunkSize);
    RemoteOperationResult chunkResult = uploadChunk(client, uploadFolderUri, missingChunk);
  int moveResult = client.executeMethod(moveMethod);
  result = new RemoteOperationResult(isSuccess(moveResult), moveMethod);
} catch (Exception e) {
  if (putMethod != null && putMethod.isAborted()) {
origin: nextcloud/android-library

putMethod = createPutMethod(chunkUri);
result = new RemoteOperationResult(isSuccess(status), putMethod);
com.owncloud.android.lib.resources.filesChunkedFileUploadRemoteOperation

Most used methods

  • checkMissingChunks
  • <init>
  • createPutMethod
  • findNextFittingChunk
  • isSuccess
  • uploadChunk

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • String (java.lang)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now