File tree Expand file tree Collapse file tree 1 file changed +15
-19
lines changed
flinkx-ftp/flinkx-ftp-core/src/main/java/com/dtstack/flinkx/ftp Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -143,28 +143,24 @@ public boolean isFileExist(String filePath) {
143143 @ Override
144144 public List <String > getFiles (String path ) {
145145 List <String > sources = new ArrayList <>();
146- if (isDirExist (path )) {
147- if (!path .endsWith (SP )) {
148- path = path + SP ;
149- }
150- try {
151- ftpClient .enterLocalPassiveMode ();
152- FTPFile [] ftpFiles = ftpClient .listFiles (new String (path .getBytes (StandardCharsets .UTF_8 ),FTP .DEFAULT_CONTROL_ENCODING ));
153- if (ftpFiles != null ) {
154- for (FTPFile ftpFile : ftpFiles ) {
155- sources .addAll (getFiles (path + ftpFile .getName (), ftpFile ));
156- }
157- }
158- } catch (IOException e ) {
159- LOG .error ("" , e );
160- throw new RuntimeException (e );
161- }
162-
163- } else if (isFileExist (path )) {
146+ if (isFileExist (path )) {
164147 sources .add (path );
165148 return sources ;
149+ }else {
150+ path = path + SP ;
151+ }
152+ try {
153+ ftpClient .enterLocalPassiveMode ();
154+ FTPFile [] ftpFiles = ftpClient .listFiles (new String (path .getBytes (StandardCharsets .UTF_8 ),FTP .DEFAULT_CONTROL_ENCODING ));
155+ if (ftpFiles != null ) {
156+ for (FTPFile ftpFile : ftpFiles ) {
157+ sources .addAll (getFiles (path + ftpFile .getName (), ftpFile ));
158+ }
159+ }
160+ } catch (IOException e ) {
161+ LOG .error ("" , e );
162+ throw new RuntimeException (e );
166163 }
167-
168164 return sources ;
169165 }
170166
You can’t perform that action at this time.
0 commit comments