TAILIEUCHUNG - Java 6 Platform Revealed phần 4

Tham khảo tài liệu 'java 6 platform revealed phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 48 CHAPTER 3 I O NETWORKING AND SECURITY UPDATES Map to return Map String List String cookieMap new HashMap String List String requestHeaders Convert StringBuilder to List store in map if 0 List String list Cookie list CookieMap cookieMap Make read-only return cookieMap In Java 6 the ListCookieHandler turns into the CookieManager class. The cookieJar that is used as the cache becomes the CookieStore. One thing not in this implementation of CookieHandler is a policy for storing cookies. Do you want to accept no cookies all cookies or only cookies from the original server That s where the CookiePolicy class comes into play. You will explore CookiePolicy more later. The last part of the Java 5 situation is the Cookie class itself. The constructor parses out the fields from the header line. Listing 3-5 shows an implementation that will be replaced in Java 6 by HttpCookie. The Java 6 version will also be more complete. Listing 3-5. Implementing a Cookie Class to Save for Java 5 import . import . import . public class Cookie String name String value URI uri CHAPTER 3 I O NETWORKING AND SECURITY UPDATES 49 String domain Date expires String path private static DateFormat expiresFormatl new SimpleDateFormat E dd MMM yyyy k m s GMT private static DateFormat expiresFormat2 new SimpleDateFormat E dd-MMM-yyyy k m s GMT public Cookie URI uri String header String attributes String nameValue attributes 0 .trim uri 0 1 for int i 1 i i nameValue attributes i .trim int equals if equals -1 continue String name 0 equals String value equals 1 if .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.