⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xpageproperties.java

📁 XBrowser是一个完全免费并且开源的Web浏览器
💻 JAVA
字号:
/****************************************************************
*              XBrowser  -  eXtended web Browser                *
*                                                               *
*           Copyright (c) 2000-2001  Armond Avanes              *
*     Refer to ReadMe & License files for more information      *
*                                                               *
*                                                               *
*                      By: Armond Avanes                        *
*       Armond555@yahoo.com     &    Armond333@yahoo.com        *
*                http://xbrowser.sourceforge.net/               *
*****************************************************************/
package xbrowser.renderer;

import java.util.*;
import java.text.*;
import java.net.*;
import java.io.*;

/**
 * Properties that every renderer can extract on loading.
 */
public class XPageProperties
{
	public XPageProperties(URLConnection conn, URL page)
	{
		url = page.toString();
		protocol = page.getProtocol();
		contentType = conn.getContentType();
		connectionType = conn.getHeaderField("Connection");
		size = Integer.toString( conn.getContentLength() );
		created = df.format( new Date(conn.getDate()) );
		modified = df.format( new Date(conn.getLastModified()) );
	}

    public XPageProperties(String _url, String ct, long _size, long mod)
    {
        url = _url;
        protocol = "http";
        contentType = ct;
        size = Long.toString( _size);
        created = df.format( new Date( mod));
        modified = created;
		connectionType = "Taken from cache";
    }

	public String getURL()
	{
		return url;
	}

	public String getProtocol()
	{
		return protocol;
	}

	public String getContentType()
	{
		return contentType;
	}

	public String getConnectionType()
	{
		return connectionType;
	}

	public String getCreated()
	{
		return created;
	}

	public String getModified()
	{
		return modified;
	}

	public String getSize()
	{
		return size;
	}

	public File getCacheFile()
	{
		return cacheFile;
	}

	public boolean isFromCache()
	{
		return fromCache;
	}

	public void setCachingInfo(File cache_file, boolean from_cache)
	{
	    cacheFile = cache_file;
		fromCache = from_cache;
	}

// Attributes:
	private static DateFormat df = DateFormat.getDateInstance();

	private String url;
	private String protocol;
	private String contentType;
	private String connectionType;
	private String created, modified;
	private String size = "0";

	private File cacheFile; // null if not cacheable
	private boolean fromCache;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -