Tennessee Gibbs 6 lat temu
rodzic
commit
1a91a1fbb8

+ 6
- 0
src/.idea/misc.xml Wyświetl plik

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

+ 8
- 0
src/.idea/modules.xml Wyświetl plik

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 9
- 0
src/.idea/src.iml Wyświetl plik

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+    <exclude-output />
5
+    <content url="file://$MODULE_DIR$" />
6
+    <orderEntry type="inheritedJdk" />
7
+    <orderEntry type="sourceFolder" forTests="false" />
8
+  </component>
9
+</module>

+ 171
- 0
src/.idea/workspace.xml Wyświetl plik

@@ -0,0 +1,171 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="63f6f833-26c0-46ac-b196-cd059812af6f" name="Default" comment="" />
5
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
6
+    <option name="TRACKING_ENABLED" value="true" />
7
+    <option name="SHOW_DIALOG" value="false" />
8
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
9
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
10
+    <option name="LAST_RESOLUTION" value="IGNORE" />
11
+  </component>
12
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
13
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
14
+  <component name="JsGulpfileManager">
15
+    <detection-done>true</detection-done>
16
+    <sorting>DEFINITION_ORDER</sorting>
17
+  </component>
18
+  <component name="NodePackageJsonFileManager">
19
+    <packageJsonPaths />
20
+  </component>
21
+  <component name="ProjectFrameBounds">
22
+    <option name="x" value="53" />
23
+    <option name="y" value="23" />
24
+    <option name="width" value="1299" />
25
+    <option name="height" value="822" />
26
+  </component>
27
+  <component name="ProjectView">
28
+    <navigator proportions="" version="1">
29
+      <foldersAlwaysOnTop value="true" />
30
+    </navigator>
31
+    <panes>
32
+      <pane id="AndroidView" />
33
+      <pane id="ProjectPane" />
34
+      <pane id="PackagesPane" />
35
+      <pane id="Scope" />
36
+    </panes>
37
+  </component>
38
+  <component name="PropertiesComponent">
39
+    <property name="WebServerToolWindowFactoryState" value="false" />
40
+    <property name="aspect.path.notification.shown" value="true" />
41
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
42
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
43
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
44
+  </component>
45
+  <component name="RunDashboard">
46
+    <option name="ruleStates">
47
+      <list>
48
+        <RuleState>
49
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
50
+        </RuleState>
51
+        <RuleState>
52
+          <option name="name" value="StatusDashboardGroupingRule" />
53
+        </RuleState>
54
+      </list>
55
+    </option>
56
+  </component>
57
+  <component name="RunManager">
58
+    <configuration default="true" type="Application" factoryName="Application">
59
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
60
+    </configuration>
61
+    <configuration default="true" type="JUnit" factoryName="JUnit">
62
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
63
+      <option name="ALTERNATIVE_JRE_PATH" />
64
+      <option name="PACKAGE_NAME" />
65
+      <option name="MAIN_CLASS_NAME" />
66
+      <option name="METHOD_NAME" />
67
+      <option name="TEST_OBJECT" value="class" />
68
+      <option name="VM_PARAMETERS" value="-ea" />
69
+      <option name="PARAMETERS" />
70
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
71
+      <option name="PASS_PARENT_ENVS" value="true" />
72
+      <option name="TEST_SEARCH_SCOPE">
73
+        <value defaultName="singleModule" />
74
+      </option>
75
+      <patterns />
76
+    </configuration>
77
+    <configuration default="true" type="TestNG" factoryName="TestNG">
78
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
79
+      <option name="ALTERNATIVE_JRE_PATH" />
80
+      <option name="SUITE_NAME" />
81
+      <option name="PACKAGE_NAME" />
82
+      <option name="MAIN_CLASS_NAME" />
83
+      <option name="METHOD_NAME" />
84
+      <option name="GROUP_NAME" />
85
+      <option name="TEST_OBJECT" value="CLASS" />
86
+      <option name="VM_PARAMETERS" value="-ea" />
87
+      <option name="PARAMETERS" />
88
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
89
+      <option name="OUTPUT_DIRECTORY" />
90
+      <option name="PASS_PARENT_ENVS" value="true" />
91
+      <option name="TEST_SEARCH_SCOPE">
92
+        <value defaultName="singleModule" />
93
+      </option>
94
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
95
+      <option name="PROPERTIES_FILE" />
96
+      <properties />
97
+      <listeners />
98
+    </configuration>
99
+  </component>
100
+  <component name="SvnConfiguration">
101
+    <configuration />
102
+  </component>
103
+  <component name="TaskManager">
104
+    <task active="true" id="Default" summary="Default task">
105
+      <changelist id="63f6f833-26c0-46ac-b196-cd059812af6f" name="Default" comment="" />
106
+      <created>1528738791847</created>
107
+      <option name="number" value="Default" />
108
+      <option name="presentableId" value="Default" />
109
+      <updated>1528738791847</updated>
110
+      <workItem from="1528738793088" duration="9000" />
111
+    </task>
112
+    <servers />
113
+  </component>
114
+  <component name="TimeTrackingManager">
115
+    <option name="totallyTimeSpent" value="9000" />
116
+  </component>
117
+  <component name="ToolWindowManager">
118
+    <frame x="53" y="23" width="1299" height="822" extended-state="0" />
119
+    <layout>
120
+      <window_info anchor="right" id="Palette" />
121
+      <window_info anchor="bottom" id="TODO" order="6" />
122
+      <window_info anchor="right" id="Palette&#9;" />
123
+      <window_info id="Image Layers" />
124
+      <window_info anchor="right" id="Capture Analysis" />
125
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
126
+      <window_info anchor="right" id="Maven Projects" />
127
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
128
+      <window_info anchor="bottom" id="Run" order="2" />
129
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
130
+      <window_info anchor="bottom" id="Terminal" />
131
+      <window_info id="Capture Tool" />
132
+      <window_info id="Designer" />
133
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24942264" />
134
+      <window_info anchor="right" id="Database" />
135
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
136
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
137
+      <window_info id="UI Designer" />
138
+      <window_info anchor="right" id="Theme Preview" />
139
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
140
+      <window_info id="Favorites" side_tool="true" />
141
+      <window_info anchor="bottom" id="Find" order="1" />
142
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
143
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
144
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
145
+      <window_info anchor="bottom" id="Message" order="0" />
146
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
147
+    </layout>
148
+  </component>
149
+  <component name="TypeScriptGeneratedFilesManager">
150
+    <option name="version" value="1" />
151
+  </component>
152
+  <component name="VcsContentAnnotationSettings">
153
+    <option name="myLimit" value="2678400000" />
154
+  </component>
155
+  <component name="masterDetails">
156
+    <states>
157
+      <state key="ProjectJDKs.UI">
158
+        <settings>
159
+          <last-edited>1.8</last-edited>
160
+          <splitter-proportions>
161
+            <option name="proportions">
162
+              <list>
163
+                <option value="0.2" />
164
+              </list>
165
+            </option>
166
+          </splitter-proportions>
167
+        </settings>
168
+      </state>
169
+    </states>
170
+  </component>
171
+</project>

+ 22
- 0
src/main/java/Main.java Wyświetl plik

@@ -1,7 +1,29 @@
1
+import java.net.URL;
2
+import java.net.URLConnection;
3
+import java.util.Scanner;
4
+
1 5
 public class Main {
2 6
     public static void main(String[] args) {
7
+        System.out.println("Enter a url:");
3 8
         //ask for a url
9
+        Scanner scanner = new Scanner(System.in);
10
+        String url = scanner.nextLine().trim();
11
+        System.out.println("Fetching " + url);
12
+
4 13
         // fetch the url
14
+        String content = null;
15
+        URLConnection connection = null;
16
+        try {
17
+            connection =  new URL("https://" + url).openConnection();
18
+            Scanner urlscanner = new Scanner(connection.getInputStream());
19
+            urlscanner.useDelimiter("\\Z");
20
+
21
+
22
+            content = urlscanner.next();
23
+        }catch ( Exception ex ) {
24
+            ex.printStackTrace();
25
+        }
26
+        System.out.println(content);
5 27
         // print the url
6 28
     }
7 29
 }

BIN
target/classes/Main.class Wyświetl plik