Skip to content

Commit 3e8c8ce

Browse files
committed
Remote file conversion parameters are not passed #27
1 parent d4ae757 commit 3e8c8ce

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/com/convertapi/client/ConvertApi.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,20 @@ public static Path convertRemoteFile(String url, String toPathToFile, Param... p
219219

220220
@SuppressWarnings("unused")
221221
public static Path convertRemoteFile(String url, String toPathToFile, String secret, Param... params) {
222-
return convertRemoteFile(url, toPathToFile, Config.defaults(secret));
222+
return convertRemoteFile(url, toPathToFile, Config.defaults(secret), params);
223223
}
224224

225225
@SuppressWarnings("unused")
226226
public static Path convertRemoteFile(String url, String toPathToFile, String token, String apiKey, Param... params) {
227-
return convertRemoteFile(url, toPathToFile, Config.defaults(token, apiKey));
227+
return convertRemoteFile(url, toPathToFile, Config.defaults(token, apiKey), params);
228228
}
229229

230230
public static Path convertRemoteFile(String url, String toPathToFile, Config config, Param... params) {
231231
RemoteUploadResponse response = Http.remoteUpload(url, config);
232232
try {
233233
Path toPath = Paths.get(toPathToFile);
234-
return convert(response.FileExt, getFileExtension(toPath), new Param[]{
235-
new Param("file", response.FileId)
236-
}, config).get().saveFile(toPath).get();
234+
Param[] fileParam = new Param[]{new Param("file", response.FileId)};
235+
return convert(response.FileExt, getFileExtension(toPath), Param.concat(fileParam, params), config).get().saveFile(toPath).get();
237236
} catch (ExecutionException | InterruptedException e) {
238237
throw new RuntimeException(e);
239238
}

0 commit comments

Comments
 (0)