FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SecurityShepherd/src/main/java/utils/GetJson.java at dev · OWASP/SecurityShepherd · GitHub
OWASP
/
SecurityShepherd
Public
Notifications
You must be signed in to change notification settings
Fork
515
Star
1.5k
Code
Issues
137
Pull requests
21
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
SecurityShepherd
/
src
/
main
/
java
/
utils
/
GetJson.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (28 loc) · 866 Bytes
Breadcrumbs
SecurityShepherd
/
src
/
main
/
java
/
utils
/
GetJson.java
Copy path
File metadata and controls
32 lines (28 loc) · 866 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package
utils
;
import
java
.
io
.
BufferedReader
;
import
org
.
apache
.
logging
.
log4j
.
LogManager
;
import
org
.
apache
.
logging
.
log4j
.
Logger
;
import
org
.
json
.
JSONArray
;
public
class
GetJson
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
GetJson
.
class
);
public
static
JSONArray
getJssonArrayFromPost
(
BufferedReader
reader
) {
StringBuffer
jb
=
new
StringBuffer
();
String
line
=
null
;
// Buffer entire JSON array
try
{
while
((
line
=
reader
.
readLine
()) !=
null
) {
jb
.
append
(
line
);
}
}
catch
(
Exception
e
) {
log
.
error
(
"Unable to buffer JSON array from request."
);
}
try
{
JSONArray
jsonArray
=
new
JSONArray
(
jb
.
toString
());
return
jsonArray
;
}
catch
(
Exception
e
) {
// crash and burn
log
.
error
(
"Unable to Extract or Parse JSONObject from JSON Buffer"
);
}
return
null
;
}
}
Back
|
FazBrowse Home
|
New Git URL