You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LargeFileRepository.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (C) 2015, Matthias Sohn <matthias.sohn@sap.com> and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.lfs.server;
  11. import java.io.IOException;
  12. import org.eclipse.jgit.annotations.Nullable;
  13. import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
  14. /**
  15. * Abstraction of a repository for storing large objects
  16. *
  17. * @since 4.3
  18. */
  19. public interface LargeFileRepository {
  20. /**
  21. * Get download action
  22. *
  23. * @param id
  24. * id of the object to download
  25. * @return Action for downloading the object
  26. */
  27. Response.Action getDownloadAction(AnyLongObjectId id);
  28. /**
  29. * Get upload action
  30. *
  31. * @param id
  32. * id of the object to upload
  33. * @param size
  34. * size of the object to be uploaded
  35. * @return Action for uploading the object
  36. */
  37. Response.Action getUploadAction(AnyLongObjectId id, long size);
  38. /**
  39. * Get verify action
  40. *
  41. * @param id
  42. * id of the object to be verified
  43. * @return Action for verifying the object, or {@code null} if the server
  44. * doesn't support or require verification
  45. */
  46. @Nullable
  47. Response.Action getVerifyAction(AnyLongObjectId id);
  48. /**
  49. * Get size of an object
  50. *
  51. * @param id
  52. * id of the object
  53. * @return length of the object content in bytes, -1 if the object doesn't
  54. * exist
  55. * @throws java.io.IOException
  56. */
  57. long getSize(AnyLongObjectId id) throws IOException;
  58. }