Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csbase-dev
rest-client-demo-java
Commits
107d8b31
Commit
107d8b31
authored
Nov 22, 2016
by
Erica Freitas de Linhares e Riello
Browse files
removendo logs desnecessários
parent
ef265f78
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/Requests/Jobs/JobServices.java
View file @
107d8b31
...
...
@@ -37,7 +37,7 @@ public class JobServices {
Response
response
=
invocationBuilder
.
header
(
HttpHeaders
.
AUTHORIZATION
,
token
.
getTokenType
()
+
token
.
getAccessToken
())
.
post
(
Entity
.
entity
(
form
,
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
),
Response
.
class
);
System
.
out
.
println
(
"jobSession response status "
+
response
.
getStatus
());
//
System.out.println("jobSession response status "+response.getStatus());
return
new
Gson
().
fromJson
(
response
.
readEntity
(
String
.
class
),
JobSession
.
class
);
}
...
...
@@ -58,8 +58,8 @@ public class JobServices {
.
post
(
Entity
.
entity
(
body
,
MediaType
.
APPLICATION_JSON_TYPE
),
Response
.
class
);
if
(
response
.
getStatus
()
==
Response
.
Status
.
OK
.
getStatusCode
())
return
response
.
readEntity
(
String
.
class
);
System
.
out
.
println
(
response
.
getStatus
());
System
.
out
.
println
(
response
.
readEntity
(
String
.
class
));
//
System.out.println(response.getStatus());
//
System.out.println(response.readEntity(String.class));
return
null
;
}
...
...
@@ -102,7 +102,7 @@ public class JobServices {
break
;
else
{
System
.
out
.
println
(
currDate
);
//
System.out.println(currDate);
currDate
=
info
.
getDate
();
}
}
...
...
@@ -125,7 +125,7 @@ public class JobServices {
if
(
response
.
getStatus
()
==
Response
.
Status
.
OK
.
getStatusCode
())
{
String
str
=
response
.
readEntity
(
String
.
class
);
System
.
out
.
println
(
str
);
//
System.out.println(str);
return
new
Gson
().
fromJson
(
str
,
JobPullInfo
.
class
);
}
return
null
;
...
...
src/main/java/Requests/Projects/FileExplorer.java
View file @
107d8b31
...
...
@@ -128,7 +128,7 @@ public class FileExplorer {
WebTarget
webTarget
=
client
.
target
(
host
);
String
fileId
=
Base64
.
getEncoder
().
encodeToString
(
projectFolderPath
.
equals
(
"root"
)
?
fileName
.
getBytes
()
:
(
projectFolderPath
+
(
fileName
==
null
?
""
:
"/"
+
fileName
)).
getBytes
());
System
.
out
.
println
(
fileId
);
//
System.out.println(fileId);
WebTarget
uploadTarget
=
webTarget
.
path
(
"projects"
).
path
(
project
.
getId
()).
path
(
"files"
).
path
(
fileId
)
.
path
(
"link"
);
...
...
@@ -154,6 +154,7 @@ public class FileExplorer {
ReadableByteChannel
rbc
=
Channels
.
newChannel
(
website
.
openStream
());
FileOutputStream
fos
=
new
FileOutputStream
(
destinFileName
);
fos
.
getChannel
().
transferFrom
(
rbc
,
0
,
Long
.
MAX_VALUE
);
fos
.
close
();
}
catch
(
MalformedURLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
...
...
@@ -171,6 +172,7 @@ public class FileExplorer {
throw
new
PermissionException
();
else
if
(
status
==
Response
.
Status
.
NOT_FOUND
.
getStatusCode
())
throw
new
ProjectOrFileNotFoundException
();
System
.
out
.
println
(
status
);
throw
new
ProjectOrFileNotFoundException
();
//System.out.println(status);
}
}
target/classes/Requests/Jobs/JobServices.class
View file @
107d8b31
No preview for this file type
target/classes/Requests/Projects/FileExplorer.class
View file @
107d8b31
No preview for this file type
Write
Preview
Supports
Markdown
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