Skip to content

Commit 5a9d7a1

Browse files
committed
refactor
1 parent ce69945 commit 5a9d7a1

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

smartling-files-api/src/main/java/com/smartling/api/files/v2/FilesApi.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,83 +43,82 @@
4343

4444
@Produces(APPLICATION_JSON)
4545
@Consumes(APPLICATION_JSON)
46-
@Path("/files-api/v2")
4746
@DetailedErrorMessage(args = "fileUri")
4847
public interface FilesApi extends AutoCloseable
4948
{
5049
@POST
51-
@Path("/projects/{projectId}/file")
50+
@Path("/files-api/v2/projects/{projectId}/file")
5251
@Consumes(MULTIPART_FORM_DATA)
5352
UploadFileResponse uploadFile(@PathParam("projectId") String projectId, @MultipartForm UploadFilePTO uploadFilePTO);
5453

5554
@GET
56-
@Path("/projects/{projectId}/file")
55+
@Path("/files-api/v2/projects/{projectId}/file")
5756
@Produces(WILDCARD)
5857
InputStream downloadSourceFile(@PathParam("projectId") String projectId, @QueryParam("fileUri") String fileUri);
5958

6059
@GET
61-
@Path("/projects/{projectId}/file/status")
60+
@Path("/files-api/v2/projects/{projectId}/file/status")
6261
FileStatusResponse getFileStatus(@PathParam("projectId") String projectId, @QueryParam("fileUri") String fileUri);
6362

6463
@GET
65-
@Path("/projects/{projectId}/locales/{localeId}/file/status")
64+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/status")
6665
FileLocaleStatusResponse getFileLocaleStatus(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @QueryParam("fileUri") String fileUri);
6766

6867
@GET
69-
@Path("/projects/{projectId}/locales/{localeId}/file")
68+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file")
7069
@Produces(WILDCARD)
7170
InputStream downloadTranslatedFile(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam DownloadTranslationPTO downloadTranslationPTO);
7271

7372
@GET
74-
@Path("/projects/{projectId}/locales/{localeId}/file")
73+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file")
7574
@Produces(MULTIPART_MIXED)
7675
TranslatedFileMultipart downloadTranslatedFileMultipart(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam DownloadTranslationPTO downloadTranslationPTO);
7776

7877
@GET
79-
@Path("/projects/{projectId}/locales/all/file/zip")
78+
@Path("/files-api/v2/projects/{projectId}/locales/all/file/zip")
8079
@Produces(WILDCARD)
8180
InputStream downloadAllFileTranslations(@PathParam("projectId") String projectId, @BeanParam DownloadAllFileTranslationsPTO downloadAllFileTranslationsPTO);
8281

8382
@GET
84-
@Path("/projects/{projectId}/files/zip")
83+
@Path("/files-api/v2/projects/{projectId}/files/zip")
8584
@Produces(WILDCARD)
8685
InputStream downloadMultipleFileTranslations(@PathParam("projectId") String projectId, @BeanParam DownloadMultipleTranslationsPTO downloadMultipleTranslationsPTO);
8786

8887
@GET
89-
@Path("/projects/{projectId}/files/list")
88+
@Path("/files-api/v2/projects/{projectId}/files/list")
9089
ListResponse<FileItemPTO> getFilesList(@PathParam("projectId") String projectId, @BeanParam GetFilesListPTO getFilesListPTO);
9190

9291
@GET
93-
@Path("/projects/{projectId}/files/list/recently-published")
92+
@Path("/published-files-api/v2/projects/{projectId}/files/list/recently-published")
9493
ListResponse<RecentlyPublishedFileItemPTO> getRecentlyPublishedFiles(@PathParam("projectId") String projectId, @BeanParam GetRecentlyPublishedFilesPTO getRecentlyPublishedFilesPTO);
9594

9695
@GET
9796
@Path("/files-api/v2/projects/{projectId}/file-types")
9897
FileTypesListPTO getFilesTypesList(@PathParam("projectId") String projectId);
9998

10099
@POST
101-
@Path("/projects/{projectId}/file/rename")
100+
@Path("/files-api/v2/projects/{projectId}/file/rename")
102101
EmptyData renameFile(@PathParam("projectId") String projectId, RenameFilePto renameFilePto);
103102

104103
@POST
105-
@Path("/projects/{projectId}/file/delete")
104+
@Path("/files-api/v2/projects/{projectId}/file/delete")
106105
EmptyData deleteFile(@PathParam("projectId") String projectId, DeleteFilePTO deleteFilePTO);
107106

108107
@GET
109-
@Path("/projects/{projectId}/file/last-modified")
108+
@Path("/files-api/v2/projects/{projectId}/file/last-modified")
110109
ListResponse<FileLocaleLastModifiedPTO> getFileLastModified(@PathParam("projectId") String projectId, @BeanParam GetFileLastModifiedPTO getFileLastModifiedPto);
111110

112111
@GET
113-
@Path("/projects/{projectId}/locales/{localeId}/file/last-modified")
112+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/last-modified")
114113
FileLocaleLastModifiedPTO getFileLocaleLastModified(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam GetFileLastModifiedPTO getFileLastModifiedPto);
115114

116115
@POST
117-
@Path("/projects/{projectId}/locales/{localeId}/file/import")
116+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/import")
118117
@Consumes(MULTIPART_FORM_DATA)
119118
ImportTranslationsResponse importTranslations(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @MultipartForm ImportTranslationsPTO importTranslationsPTO);
120119

121120
@POST
122-
@Path("/projects/{projectId}/locales/{localeId}/file/get-translations")
121+
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/get-translations")
123122
@Consumes(MULTIPART_FORM_DATA)
124123
@Produces(WILDCARD)
125124
InputStream exportTranslations(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @MultipartForm ExportTranslationsPTO exportTranslationsPTO);

smartling-files-api/src/test/java/com/smartling/api/files/v2/FilesApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void testGetRecentlyPublishedFilesList() throws Exception {
299299

300300
RecordedRequest recordedRequest = mockWebServer.takeRequest();
301301
assertEquals("GET", recordedRequest.getMethod());
302-
assertTrue(recordedRequest.getPath().contains("/projects/" + PROJECT_ID + "/files/list/recently-published"));
302+
assertTrue(recordedRequest.getPath().contains("/published-files-api/v2/projects/" + PROJECT_ID + "/files/list/recently-published"));
303303
assertTrue(recordedRequest.getPath().contains("fileUris" + URLEncoder.encode("[]", "UTF-8") + "=" + FILE_URI));
304304
assertTrue(recordedRequest.getPath().contains("publishedAfter=" + URLEncoder.encode("2018-07-20T00:6:34Z", "UTF-8")));
305305
assertTrue(recordedRequest.getPath().contains("localeIds" + URLEncoder.encode("[]", "UTF-8") + "=" + "de-DE"));

0 commit comments

Comments
 (0)