Java ?? ?? Java URLConnection? ??? ???? ??
Java?? URLConnection? User-Agent ??? ???? ????? " Java/version"? ??? ???? ??? ?? ?????. ??? ??? ?? User-Agent? ???? ?? ??? ?????.
Java 1.6.30 ??
Java ?? 1.6.30 ????? setRequestProperty("User-Agent", "user-agent-string") ? Java ?? ?? ????? ?????. ?? netcat? ?? ?? ???? ???? ??? ???? ??? ? ????.
$ nc -l -p 8080
setRequestProperty? ??? ??? ??? ????.
GET /foobar HTTP/1.1 User-Agent: Java/1.6.0_30 Host: localhost:8080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive
setRequestProperty? ???? ???- ????? ???? ?????:
GET /foobar HTTP/1.1 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 Host: localhost:8080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive
?? ?:
import java.io.IOException; import java.net.URL; import java.net.URLConnection; public class TestUrlOpener { public static void main(String[] args) throws IOException { URL url = new URL("http://localhost:8080/foobar"); URLConnection hc = url.openConnection(); hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"); System.out.println(hc.getContentType()); } }
? ??? Java ?? ?? Java URLConnection? ??? ????? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Stock Market GPT
? ??? ??? ?? AI ?? ?? ??

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

-CP ?? ??? ???? JVM? ClassPath? ???? JAVA -Clibrary.jarcom.example.Main? ?? ?? ??? ? ?????? ? ? ???, ?? ???? ?? ???? ?? ? ?? ???? ???? ??? ?? ?? ?? ?? Manifest.MF? ?? ?? ? ? ????.

usefile.createnewfile () to reatefileonlyifitdoesn'texist, ???;

Javaspi? JDK? ?? ??? ?? ?????? Serviceloader? ?? ????? ?? ?? ??? ?????. 1. ??? ?????? ???? Meta-Inf/Services/?? ?????? ?? ??? ?? ??? ???? ?? ???? ??? ? ??? ??????. 2. serviceloader.load ()? ???? ?? ???????? JVM? ???? ??? ?? ????????. 3. ????? ??? ?? ?? ?? ??? ?? ?? ? ?????? ???? ?? ??? ???????. 4. ?? ???? ?????? ?? ?? ?? ??? ? ???? ??? ?????. 5. ??, ??? ??, ?? ??, ??? ?? ? ?? ??????????. 6. Java9??? ?? ???? ?? ?? ? ? ????.

Amplements ???? ???? ?????? ??????. ? ???? ??????? ?? ???? ?? ??? ???????. ?? ?????? ???? ???? ????? ??? ?????. Java 8 ??? ?? ? ?? ???? ?? ??? ??? ????.

javagenericsprovidecompile-timetypesafetyandeliminatecastingtypeparametersonclasses, interfaces, methods; wildcards (?,? extendStype,? supertype) handlUnknowntypeswithflexible.1.useUnunUnunUndwildCardWhentyPeiLISIRVENTERREATHERNEATHEATHEATHEATHEATHEATHEATHEATHEATHEARVENTOUBERDERRELOUNTERRELONTERREATHEARBERBERBENTECASTS;

? ????? ??? TCP ??, ? HTTP ?? ?? (Keep-Alive)?? ?? HTTP ??? ???? ????? ????? ?? ???. ? ??? HTTP/1.X? HTTP/2 ????? ??? ????? ???? ??? ?? ?? ? ??? ???? ??? ???? ???? ?? : ?? ??? ???? ???? ??? ?????. ???? ??? ???? ?? ??? ?????? ???? ????? ??? HTTP ?????? ?? ? ? ??? ?????.

? ????? Java? ?? ?? ??? ???? ?? ? ?? ??? ????? ???? ?? ?? ??? ?? ??? ???? ??? ??? ?????. ? ??? Java 8 Stream API? FlatMap ??? ?? ? ?? ?? ???? ?????. ? ??? ???? ??? ?? ??? ??? ?? ????? ??? ????? ?? ??? ??? ?? ?????.

?? ???? ???? Java ?? ??? ?? ?????. 1. config.properties? ??? ????? ?? getClassLoader (). getResourCeasStream ()? ???????? () ???? ???? ?????? ??? ????. 2. ??? ?? ????? ?? FileInputStream? ??????????. 3. GetProperty (?, ???)? ???? ?? ? ?? ???? ???? ???? ?? ?? ? ?? ??? ?????.
