瀏覽代碼

updated fido. not something you can run from command line. hmm.

Allison Ziegler 6 年之前
父節點
當前提交
abc9f341e5
共有 6 個檔案被更改,包括 68 行新增1 行删除
  1. 1
    1
      .idea/compiler.xml
  2. 3
    0
      .idea/misc.xml
  3. 1
    0
      .idea/modules.xml
  4. 二進制
      classes/production/java/Fido.class
  5. 11
    0
      java/java.iml
  6. 52
    0
      java/src/Fido.java

+ 1
- 1
.idea/compiler.xml 查看文件

@@ -10,7 +10,7 @@
10 10
       </profile>
11 11
     </annotationProcessing>
12 12
     <bytecodeTargetLevel>
13
-      <module name="ZCW-Fido-URLFetch" target="1.5" />
13
+      <module name="ZCW-Fido-URLFetch" target="1.8" />
14 14
     </bytecodeTargetLevel>
15 15
   </component>
16 16
 </project>

+ 3
- 0
.idea/misc.xml 查看文件

@@ -7,4 +7,7 @@
7 7
       </list>
8 8
     </option>
9 9
   </component>
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
11
+    <output url="file://$PROJECT_DIR$/classes" />
12
+  </component>
10 13
 </project>

+ 1
- 0
.idea/modules.xml 查看文件

@@ -3,6 +3,7 @@
3 3
   <component name="ProjectModuleManager">
4 4
     <modules>
5 5
       <module fileurl="file://$PROJECT_DIR$/.idea/ZCW-Fido-URLFetch.iml" filepath="$PROJECT_DIR$/.idea/ZCW-Fido-URLFetch.iml" />
6
+      <module fileurl="file://$PROJECT_DIR$/java/java.iml" filepath="$PROJECT_DIR$/java/java.iml" />
6 7
     </modules>
7 8
   </component>
8 9
 </project>

二進制
classes/production/java/Fido.class 查看文件


+ 11
- 0
java/java.iml 查看文件

@@ -0,0 +1,11 @@
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
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
+    </content>
8
+    <orderEntry type="inheritedJdk" />
9
+    <orderEntry type="sourceFolder" forTests="false" />
10
+  </component>
11
+</module>

+ 52
- 0
java/src/Fido.java 查看文件

@@ -0,0 +1,52 @@
1
+
2
+import java.io.BufferedReader;
3
+import java.io.IOException;
4
+import java.io.InputStream;
5
+import java.io.InputStreamReader;
6
+import java.net.MalformedURLException;
7
+import java.net.URL;
8
+import java.net.URLConnection;
9
+import java.util.Scanner;
10
+import java.util.logging.Level;
11
+import java.util.logging.Logger;
12
+
13
+
14
+public class Fido {
15
+
16
+    public static void main(String args[]) {
17
+        Scanner s = new Scanner(System.in);
18
+        Fido fido = new Fido(s.next());
19
+        fido.printHTML();
20
+    }
21
+
22
+
23
+    private URLConnection connection;
24
+    private final Logger logger = Logger.getGlobal();
25
+
26
+    public Fido(String url) {
27
+        try {
28
+            connection = new URL(url).openConnection();
29
+        }
30
+        catch (IOException e) {
31
+            logger.log(Level.SEVERE, "Invalid URL");
32
+        }
33
+    }
34
+
35
+    public void printHTML() {
36
+        try {
37
+            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
38
+            String inputline = bufferedReader.readLine();
39
+            while (inputline != null) {
40
+                System.out.println(inputline);
41
+                inputline = bufferedReader.readLine();
42
+            }
43
+        }
44
+        catch (IOException e) {
45
+            logger.log(Level.SEVERE, "404: Not Found");
46
+        }
47
+
48
+    }
49
+
50
+
51
+
52
+}