1616import static java .nio .charset .StandardCharsets .ISO_8859_1 ;
1717import static java .nio .charset .StandardCharsets .UTF_8 ;
1818
19- import com .github .stickerifier .stickerify .exception .CorruptedFileException ;
2019import com .github .stickerifier .stickerify .exception .FileOperationException ;
2120import com .github .stickerifier .stickerify .exception .MediaException ;
2221import com .github .stickerifier .stickerify .exception .ProcessException ;
@@ -146,10 +145,10 @@ private static boolean isSupportedVideo(String mimeType) {
146145 *
147146 * @param file the file to check
148147 * @return {@code true} if the file is compliant
149- * @throws FileOperationException if an error occurred retrieving the size of the file
148+ * @throws MediaException if an error occurred retrieving video information
150149 * @throws InterruptedException if the current thread is interrupted while retrieving file info
151150 */
152- private static boolean isVideoCompliant (File file ) throws FileOperationException , CorruptedFileException , InterruptedException {
151+ private static boolean isVideoCompliant (File file ) throws MediaException , InterruptedException {
153152 var mediaInfo = retrieveMultimediaInfo (file );
154153
155154 var formatInfo = mediaInfo .format ();
@@ -180,10 +179,10 @@ private static boolean isVideoCompliant(File file) throws FileOperationException
180179 *
181180 * @param file the video to check
182181 * @return passed-in video's multimedia information
183- * @throws CorruptedFileException if an error occurred retrieving file information
182+ * @throws MediaException if an error occurred retrieving file information
184183 * @throws InterruptedException if the current thread is interrupted while retrieving file info
185184 */
186- static MultimediaInfo retrieveMultimediaInfo (File file ) throws CorruptedFileException , InterruptedException {
185+ static MultimediaInfo retrieveMultimediaInfo (File file ) throws MediaException , InterruptedException {
187186 var command = new String [] {
188187 "ffprobe" ,
189188 "-hide_banner" ,
@@ -199,7 +198,7 @@ static MultimediaInfo retrieveMultimediaInfo(File file) throws CorruptedFileExce
199198
200199 return GSON .fromJson (output , MultimediaInfo .class );
201200 } catch (ProcessException | JsonSyntaxException e ) {
202- throw new CorruptedFileException ( "The file could not be processed successfully " , e );
201+ throw new MediaException ( "Unable to retrieve media information " , e );
203202 }
204203 }
205204
@@ -356,10 +355,10 @@ private static boolean isAnimatedWebp(File file) {
356355 * @param image the image to check
357356 * @param mimeType the MIME type of the file
358357 * @return {@code true} if the file is compliant
359- * @throws CorruptedFileException if an error occurred retrieving image information
358+ * @throws MediaException if an error occurred retrieving image information
360359 * @throws InterruptedException if the current thread is interrupted while retrieving file info
361360 */
362- private static boolean isImageCompliant (File image , String mimeType ) throws CorruptedFileException , InterruptedException {
361+ private static boolean isImageCompliant (File image , String mimeType ) throws MediaException , InterruptedException {
363362 var mediaInfo = retrieveMultimediaInfo (image );
364363
365364 var formatInfo = mediaInfo .format ();
0 commit comments