FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaFX/src/malc2/Methods.java at master · dmpe/JavaFX · GitHub
dmpe
/
JavaFX
Public
Notifications
You must be signed in to change notification settings
Fork
96
Star
271
Code
Issues
1
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaFX
/
src
/
malc2
/
Methods.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (23 loc) · 666 Bytes
Breadcrumbs
JavaFX
/
src
/
malc2
/
Methods.java
Copy path
File metadata and controls
27 lines (23 loc) · 666 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
package
malc2
;
import
java
.
io
.
IOException
;
import
java
.
net
.
HttpURLConnection
;
import
java
.
net
.
MalformedURLException
;
import
java
.
net
.
URL
;
public
class
Methods
{
// http://stackoverflow.com/questions/1378199/how-to-check-if-a-url-exists-or-returns-404-with-java
public
int
getResponseCode
(
String
sit
)
throws
MalformedURLException
,
IOException
{
URL
u
=
new
URL
(
sit
);
HttpURLConnection
huc
= (
HttpURLConnection
)
u
.
openConnection
();
huc
.
setRequestMethod
(
"HEAD"
);
huc
.
connect
();
return
huc
.
getResponseCode
();
}
public
String
getImp
(
int
papa
) {
if
(
papa
==
404
) {
return
"wrong"
;
}
else
{
return
"good"
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL