1
1
package com .groupdocs .ui .servlet ;
2
2
3
3
import com .fasterxml .jackson .databind .ObjectMapper ;
4
- import com .groupdocs .annotation .domain .AnnotationReplyInfo ;
5
- import com .groupdocs .annotation .domain .results .AddReplyResult ;
6
- import com .groupdocs .annotation .domain .results .GetAnnotationResult ;
7
- import com .groupdocs .annotation .handler .AnnotationImageHandler ;
8
4
import com .groupdocs .ui .Utils ;
9
5
10
6
import javax .servlet .ServletException ;
13
9
import javax .servlet .http .HttpServletRequest ;
14
10
import javax .servlet .http .HttpServletResponse ;
15
11
import java .io .IOException ;
16
- import java .nio .file .*;
12
+ import java .nio .file .Files ;
13
+ import java .nio .file .Paths ;
17
14
import java .util .ArrayList ;
18
15
19
16
@ WebServlet ("/files" )
@@ -22,10 +19,11 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
22
19
response .setHeader ("Content-Type" , "application/json" );
23
20
24
21
ArrayList <String > list = new ArrayList <>();
25
- Files .newDirectoryStream (Paths .get (Utils .getStoragePath ())).forEach (path -> {
26
- if (Files .isRegularFile (path )) {
27
- list .add (path .getFileName ().toString ());
28
- }
22
+ Files .newDirectoryStream (
23
+ Paths .get (Utils .getStoragePath ()),
24
+ entry -> Files .isRegularFile (entry ) && !entry .getFileName ().toString ().startsWith ("GroupDocs." ) && !entry .getFileName ().toString ().equalsIgnoreCase ("README.txt" )
25
+ ).forEach (path -> {
26
+ list .add (path .getFileName ().toString ());
29
27
});
30
28
31
29
new ObjectMapper ().writeValue (response .getOutputStream (), list );
0 commit comments