-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from AssemblyAI/niels/add-file-path-overloads
Add overload to files and transcript client
- Loading branch information
Showing
6 changed files
with
134 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.assemblyai.api.core; | ||
|
||
public class Constants { | ||
public static final String SDK_VERSION = "2.1.4"; | ||
public static final String SDK_VERSION = "2.2.0"; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/assemblyai/api/resources/files/ExtendedFilesClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.assemblyai.api.resources.files; | ||
|
||
import com.assemblyai.api.core.*; | ||
import com.assemblyai.api.resources.files.types.UploadedFile; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
public class ExtendedFilesClient extends FilesClient { | ||
public ExtendedFilesClient(ClientOptions clientOptions) { | ||
super(clientOptions); | ||
} | ||
|
||
/** | ||
* Upload a media file to AssemblyAI's servers. | ||
*/ | ||
public UploadedFile upload(File file) throws IOException { | ||
return upload(file, null); | ||
} | ||
|
||
/** | ||
* Upload a media file to AssemblyAI's servers. | ||
*/ | ||
public UploadedFile upload(File file, RequestOptions requestOptions) throws IOException { | ||
return upload(file.toPath(), requestOptions); | ||
} | ||
|
||
/** | ||
* Upload a media file to AssemblyAI's servers. | ||
*/ | ||
public UploadedFile upload(Path filePath) throws IOException { | ||
return upload(filePath, null); | ||
} | ||
|
||
/** | ||
* Upload a media file to AssemblyAI's servers. | ||
*/ | ||
public UploadedFile upload(Path filePath, RequestOptions requestOptions) throws IOException { | ||
return upload(Files.readAllBytes(filePath), requestOptions); | ||
} | ||
} |