FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
htmlunit-android/src/main/java/org/htmlunit/android/Main.java at main · HtmlUnit/htmlunit-android · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
HtmlUnit
/
htmlunit-android
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
9
Star
45
Code
Issues
6
Pull requests
5
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
htmlunit-android
/
src
/
main
/
java
/
org
/
htmlunit
/
android
/
Main.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
95 lines (87 loc) · 3.82 KB
Breadcrumbs
htmlunit-android
/
src
/
main
/
java
/
org
/
htmlunit
/
android
/
Main.java
Copy path
File metadata and controls
95 lines (87 loc) · 3.82 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Copyright (c) 2002-2023 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
htmlunit
.
android
;
import
org
.
htmlunit
.
SilentCssErrorHandler
;
import
org
.
htmlunit
.
WebClient
;
import
org
.
htmlunit
.
html
.
HtmlPage
;
/**
* Just a simple main class.
*
* @author Ronald Brill
*/
public
class
Main
{
public
static
void
main
(
String
[]
args
) {
final
String
[]
tmpClassNames
= {
"org.htmlunit.WebClient"
,
"org.htmlunit.corejs.javascript.Function"
,
"org.htmlunit.cyberneko.HTMLElements"
,
"org.htmlunit.xpath.XPath"
,
"org.htmlunit.cssparser.parser.CSSOMParser"
,
""
,
"org.htmlunit.org.apache.http.client.HttpClient"
,
"org.htmlunit.org.apache.http.Header"
,
"org.htmlunit.org.apache.http.entity.mime.MIME"
,
""
,
"org.eclipse.jetty.client.HttpClient"
,
"org.eclipse.jetty.http.HttpContent"
,
"org.eclipse.jetty.util.ArrayUtil"
,
"org.eclipse.jetty.io.AbstractConnection"
,
"org.eclipse.jetty.websocket.client.DefaultHttpClientProvider"
,
"org.eclipse.jetty.websocket.common.Parser"
,
"org.eclipse.jetty.websocket.api.RemoteEndpoint"
,
"org.brotli.dec.BrotliRuntimeException"
,
"com.shapesecurity.salvation2.Policy"
};
for
(
final
String
tmpClassName
:
tmpClassNames
) {
StringBuilder
info
=
new
StringBuilder
();
if
(
tmpClassName
.
length
() ==
0
) {
System
.
out
.
println
();
continue
;
}
try
{
final
Class
<?>
tmpClass
=
Class
.
forName
(
tmpClassName
);
info
.
append
(
tmpClass
.
getName
()).
append
(
" "
);
// @formatter:off
info
.
append
(
VersionUtil
.
determineVersionFromJarFileName
(
tmpClass
))
.
append
(
" ("
)
.
append
(
VersionUtil
.
determineCreationDateFromJarFileName
(
tmpClass
))
.
append
(
')'
);
// NOPMD
// @formatter:on
}
catch
(
final
ClassNotFoundException
e
) {
info
.
append
(
"Class '"
).
append
(
tmpClassName
).
append
(
"' not found in classpath."
);
}
System
.
out
.
println
(
info
.
toString
());
}
// final String[] tmpJars = { "commons-lang3-\\S+jar", "commons-text-\\S+jar", "commons-codec-\\S+jar",
// "commons-io-\\S+jar", "commons-logging-\\S+jar", "commons-net-\\S+jar"};
// for (final String tmpJar : tmpJars) {
// StringBuilder info = new StringBuilder();
// // @formatter:off
// info.append(VersionUtil.determineTitleFromJarManifest(tmpJar, null))
// .append(' ')
// .append(VersionUtil.determineVersionFromJarManifest(tmpJar, null));
// // @formatter:on
// System.out.println(info.toString());
// }
System
.
out
.
println
();
System
.
out
.
println
();
System
.
out
.
println
(
"Reading https://www.wetator.org/testform/"
);
try
(
WebClient
webClient
=
new
WebClient
()) {
webClient
.
setCssErrorHandler
(
new
SilentCssErrorHandler
());
HtmlPage
page
=
webClient
.
getPage
(
"https://www.wetator.org/testform/"
);
System
.
out
.
println
(
page
.
asNormalizedText
());
}
catch
(
Exception
e
) {
e
.
printStackTrace
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL