Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of #676 #677

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Source/com/drew/imaging/FileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public enum FileType
// Only file detection
Aac("AAC", "Advanced Audio Coding", "audio/aac", "m4a"),
Asf("ASF", "Advanced Systems Format", "video/x-ms-asf", "asf", "wma", "wmv"),
Cfbf("CFBF", "Compound File Binary Format", null, (String[])null),
Cfbf("CFBF", "Compound File Binary Format", null),
Flv("FLV", "Flash Video", "video/x-flv", ".flv", ".f4v,"),
Indd("INDD", "INDesign Document", "application/octet-stream", ".indd"),
Mxf("MXF", "Material Exchange Format", "application/mxf", "mxf"),
Expand All @@ -88,9 +88,9 @@ public enum FileType
@NotNull private final String _name;
@NotNull private final String _longName;
@Nullable private final String _mimeType;
private final String[] _extensions;
@NotNull private final String[] _extensions;

FileType(@NotNull String name, @NotNull String longName, @Nullable String mimeType, String... extensions)
FileType(@NotNull String name, @NotNull String longName, @Nullable String mimeType, @NotNull String... extensions)
{
_name = name;
_longName = longName;
Expand Down
12 changes: 11 additions & 1 deletion Tests/com/drew/imaging/FileTypeTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 Drew Noakes and contributors
* Copyright 2002-2024 Drew Noakes and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public class FileTypeTest
Expand All @@ -41,4 +42,13 @@ public void testExtensions()

assertNull(FileType.Unknown.getCommonExtension());
}

@Test
public void testCommonExtension()
{
for (FileType fileType : FileType.values()) {
String[] extensions = fileType.getAllExtensions();
assertNotNull(fileType.name(), extensions);
}
}
}
Loading