Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 79656a4

Browse files
committed
#114 Added more binary extensions
1 parent f64aecf commit 79656a4

File tree

2 files changed

+263
-3
lines changed

2 files changed

+263
-3
lines changed

src/main/java/com/marklogic/client/ext/file/DefaultDocumentFormatGetter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.marklogic.client.ext.file;
22

3+
import com.marklogic.client.ext.util.BinaryExtensions;
34
import com.marklogic.client.io.Format;
45
import org.springframework.core.io.Resource;
56

6-
import java.io.File;
77
import java.util.ArrayList;
88
import java.util.List;
99

@@ -12,8 +12,7 @@
1212
*/
1313
public class DefaultDocumentFormatGetter implements FormatGetter {
1414

15-
public final static String[] DEFAULT_BINARY_EXTENSIONS = new String[]{".swf", ".jpeg", ".jpg", ".png", ".gif",
16-
".svg", ".ttf", ".eot", ".woff", ".woff2", ".otf", ".cur", ".ico", ".gzip", ".zip", ".gz", ".tar", ".jar"};
15+
public final static String[] DEFAULT_BINARY_EXTENSIONS = BinaryExtensions.EXTENSIONS;
1716

1817
public final static String[] DEFAULT_XML_EXTENSIONS = new String[]{"xml", "xsl", "xslt", "xsd", "tdex"};
1918
public final static String[] DEFAULT_JSON_EXTENSIONS = new String[]{"json", "tdej"};
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
package com.marklogic.client.ext.util;
2+
3+
public class BinaryExtensions {
4+
5+
/**
6+
* Courtesy of https://github.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json
7+
*/
8+
public static final String[] EXTENSIONS = new String[]{
9+
"3dm",
10+
"3ds",
11+
"3g2",
12+
"3gp",
13+
"7z",
14+
"a",
15+
"aac",
16+
"adp",
17+
"ai",
18+
"aif",
19+
"aiff",
20+
"alz",
21+
"ape",
22+
"apk",
23+
"ar",
24+
"arj",
25+
"asf",
26+
"au",
27+
"avi",
28+
"bak",
29+
"baml",
30+
"bh",
31+
"bin",
32+
"bk",
33+
"bmp",
34+
"btif",
35+
"bz2",
36+
"bzip2",
37+
"cab",
38+
"caf",
39+
"cgm",
40+
"class",
41+
"cmx",
42+
"cpio",
43+
"cr2",
44+
"cur",
45+
"dat",
46+
"dcm",
47+
"deb",
48+
"dex",
49+
"djvu",
50+
"dll",
51+
"dmg",
52+
"dng",
53+
"doc",
54+
"docm",
55+
"docx",
56+
"dot",
57+
"dotm",
58+
"dra",
59+
"DS_Store",
60+
"dsk",
61+
"dts",
62+
"dtshd",
63+
"dvb",
64+
"dwg",
65+
"dxf",
66+
"ecelp4800",
67+
"ecelp7470",
68+
"ecelp9600",
69+
"egg",
70+
"eol",
71+
"eot",
72+
"epub",
73+
"exe",
74+
"f4v",
75+
"fbs",
76+
"fh",
77+
"fla",
78+
"flac",
79+
"fli",
80+
"flv",
81+
"fpx",
82+
"fst",
83+
"fvt",
84+
"g3",
85+
"gh",
86+
"gif",
87+
"graffle",
88+
"gz",
89+
"gzip",
90+
"h261",
91+
"h263",
92+
"h264",
93+
"icns",
94+
"ico",
95+
"ief",
96+
"img",
97+
"ipa",
98+
"iso",
99+
"jar",
100+
"jpeg",
101+
"jpg",
102+
"jpgv",
103+
"jpm",
104+
"jxr",
105+
"key",
106+
"ktx",
107+
"lha",
108+
"lib",
109+
"lvp",
110+
"lz",
111+
"lzh",
112+
"lzma",
113+
"lzo",
114+
"m3u",
115+
"m4a",
116+
"m4v",
117+
"mar",
118+
"mdi",
119+
"mht",
120+
"mid",
121+
"midi",
122+
"mj2",
123+
"mka",
124+
"mkv",
125+
"mmr",
126+
"mng",
127+
"mobi",
128+
"mov",
129+
"movie",
130+
"mp3",
131+
"mp4",
132+
"mp4a",
133+
"mpeg",
134+
"mpg",
135+
"mpga",
136+
"mxu",
137+
"nef",
138+
"npx",
139+
"numbers",
140+
"nupkg",
141+
"o",
142+
"oga",
143+
"ogg",
144+
"ogv",
145+
"otf",
146+
"pages",
147+
"pbm",
148+
"pcx",
149+
"pdb",
150+
"pdf",
151+
"pea",
152+
"pgm",
153+
"pic",
154+
"png",
155+
"pnm",
156+
"pot",
157+
"potm",
158+
"potx",
159+
"ppa",
160+
"ppam",
161+
"ppm",
162+
"pps",
163+
"ppsm",
164+
"ppsx",
165+
"ppt",
166+
"pptm",
167+
"pptx",
168+
"psd",
169+
"pya",
170+
"pyc",
171+
"pyo",
172+
"pyv",
173+
"qt",
174+
"rar",
175+
"ras",
176+
"raw",
177+
"resources",
178+
"rgb",
179+
"rip",
180+
"rlc",
181+
"rmf",
182+
"rmvb",
183+
"rtf",
184+
"rz",
185+
"s3m",
186+
"s7z",
187+
"scpt",
188+
"sgi",
189+
"shar",
190+
"sil",
191+
"sketch",
192+
"slk",
193+
"smv",
194+
"snk",
195+
"so",
196+
"stl",
197+
"svg", // Including this as it was originally in the list in DefaultDocumentFormatGetter
198+
"suo",
199+
"sub",
200+
"swf",
201+
"tar",
202+
"tbz",
203+
"tbz2",
204+
"tga",
205+
"tgz",
206+
"thmx",
207+
"tif",
208+
"tiff",
209+
"tlz",
210+
"ttc",
211+
"ttf",
212+
"txz",
213+
"udf",
214+
"uvh",
215+
"uvi",
216+
"uvm",
217+
"uvp",
218+
"uvs",
219+
"uvu",
220+
"viv",
221+
"vob",
222+
"war",
223+
"wav",
224+
"wax",
225+
"wbmp",
226+
"wdp",
227+
"weba",
228+
"webm",
229+
"webp",
230+
"whl",
231+
"wim",
232+
"wm",
233+
"wma",
234+
"wmv",
235+
"wmx",
236+
"woff",
237+
"woff2",
238+
"wrm",
239+
"wvx",
240+
"xbm",
241+
"xif",
242+
"xla",
243+
"xlam",
244+
"xls",
245+
"xlsb",
246+
"xlsm",
247+
"xlsx",
248+
"xlt",
249+
"xltm",
250+
"xltx",
251+
"xm",
252+
"xmind",
253+
"xpi",
254+
"xpm",
255+
"xwd",
256+
"xz",
257+
"z",
258+
"zip",
259+
"zipx"
260+
};
261+
}

0 commit comments

Comments
 (0)