Skip to content

Commit

Permalink
Delete GroupApi#uploadFile(..) method (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini authored Nov 28, 2024
1 parent 1c22c25 commit 1113839
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions src/main/java/org/gitlab4j/api/GroupApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2454,68 +2454,4 @@ public List<UploadedFile> getUploadFiles(Object groupIdOrPath) throws GitLabApiE
Response response = get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "uploads");
return (response.readEntity(new GenericType<List<UploadedFile>>() {}));
}

/**
* Uploads a file to the specified group to be used in an issue or merge request description, or a comment.
*
* <pre><code>GitLab Endpoint: POST /groups/:id/uploads</code></pre>
*
* @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance, required
* @param fileToUpload the File instance of the file to upload, required
* @return a FileUpload instance with information on the just uploaded file
* @throws GitLabApiException if any exception occurs
*/
public FileUpload uploadFile(Object groupIdOrPath, File fileToUpload) throws GitLabApiException {
return (uploadFile(groupIdOrPath, fileToUpload, null));
}

/**
* Uploads a file to the specified group to be used in an issue or merge request description, or a comment.
*
* <pre><code>GitLab Endpoint: POST /groups/:id/uploads</code></pre>
*
* @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance, required
* @param fileToUpload the File instance of the file to upload, required
* @param mediaType unused; will be removed in the next major version
* @return a FileUpload instance with information on the just uploaded file
* @throws GitLabApiException if any exception occurs
*/
public FileUpload uploadFile(Object groupIdOrPath, File fileToUpload, String mediaType) throws GitLabApiException {
Response response = upload(
Response.Status.CREATED,
"file",
fileToUpload,
mediaType,
"groups",
getGroupIdOrPath(groupIdOrPath),
"uploads");
return (response.readEntity(FileUpload.class));
}

/**
* Uploads some data in an {@link InputStream} to the specified group,
* to be used in an issue or merge request description, or a comment.
*
* <pre><code>GitLab Endpoint: POST /groups/:id/uploads</code></pre>
*
* @param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance, required
* @param inputStream the data to upload, required
* @param filename The filename of the file to upload
* @param mediaType unused; will be removed in the next major version
* @return a FileUpload instance with information on the just uploaded file
* @throws GitLabApiException if any exception occurs
*/
public FileUpload uploadFile(Object groupIdOrPath, InputStream inputStream, String filename, String mediaType)
throws GitLabApiException {
Response response = upload(
Response.Status.CREATED,
"file",
inputStream,
filename,
mediaType,
"groups",
getGroupIdOrPath(groupIdOrPath),
"uploads");
return (response.readEntity(FileUpload.class));
}
}

0 comments on commit 1113839

Please sign in to comment.