Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
155f62f9
Commit
155f62f9
authored
Aug 03, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
3c0d7031
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
FileUtil.java
src/main/java/com/egolm/common/FileUtil.java
+10
-2
FtpUtil.java
src/main/java/com/egolm/common/FtpUtil.java
+0
-1
No files found.
src/main/java/com/egolm/common/FileUtil.java
View file @
155f62f9
...
...
@@ -18,7 +18,6 @@ import java.io.OutputStream;
import
java.io.OutputStreamWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.io.Writer
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.nio.file.Files
;
...
...
@@ -256,8 +255,9 @@ public class FileUtil {
*/
public
static
byte
[]
fileToBytes
(
File
file
)
{
byte
[]
bytes
=
null
;
FileInputStream
fis
=
null
;
try
{
FileInputStream
fis
=
new
FileInputStream
(
file
);
fis
=
new
FileInputStream
(
file
);
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
(
102400
);
byte
[]
b
=
new
byte
[
102400
];
int
n
;
...
...
@@ -269,6 +269,14 @@ public class FileUtil {
bytes
=
baos
.
toByteArray
();
}
catch
(
Exception
e
)
{
throw
new
FileUtilException
(
""
,
e
);
}
finally
{
if
(
fis
!=
null
)
{
try
{
fis
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
bytes
;
}
...
...
src/main/java/com/egolm/common/FtpUtil.java
View file @
155f62f9
...
...
@@ -56,7 +56,6 @@ public class FtpUtil {
this
.
ftpClient
.
setFileType
(
FTP
.
BINARY_FILE_TYPE
,
FTP
.
BINARY_FILE_TYPE
);
this
.
ftpClient
.
setFileTransferMode
(
FTP
.
BINARY_FILE_TYPE
);
this
.
ftpClient
.
enterLocalPassiveMode
();
}
public
void
downFolder
(
final
String
localRootPath
,
final
String
remoteRootPath
,
boolean
async
,
String
backupRootPath
)
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment