Examples of AssetWithContent


Examples of net.sf.sitstart.svc.internal.AssetWithContent

    /**
     * @see net.sf.sitstart.svc.internal.AssetRetriever#retrieve(java.net.URI, boolean)
     */
    public AssetWithContent retrieve(URI uri, boolean isRoot)
    {
        AssetWithContent result = null;
       
       
        // PRECONDITIONS
        assert uri != null : "uri must not be null.";
       
View Full Code Here

Examples of net.sf.sitstart.svc.internal.AssetWithContent

    /**
     * @see net.sf.sitstart.svc.internal.Spider#addURIToQueue(java.net.URI)
     */
    public void addURIToQueue(URI uri)
    {
        AssetWithContent asset = null;
       
        // PRECONDITIONS
        assert uri != null : "uri must not be null.";
       
        // Body
View Full Code Here

Examples of net.sf.sitstart.svc.internal.AssetWithContent

    }
   
   
    public AssetWithContent retrieve(java.net.URI uri, boolean isRoot)
    {
        AssetWithContent result = null;
       
        // PRECONDITIONS
        assert uri != null : "uri must not be null.";
       
        // Body
        try
        {
            Asset               asset            = null;
            GetMethod           get              = null;
            Map<String, String> headers          = null;
            int                 statusCode       = -1;
            Date                start            = null;
            Date                end              = null;
            String              reportedMimeType = null;

            log.info("HTTP GET " + uri);
           
            get = new GetMethod(uri.toString());
           
            start      = new Date();
            statusCode = httpClient.executeMethod(get);
            end        = new Date();
           
            headers = buildHeaderMap(get);
           
            reportedMimeType = headers.get(HEADER_NAME_MIME_TYPE);
           
            asset = assetFactory.create(uri, isRoot);
           
            asset.setHeaders(buildHeaderMap(get));
            asset.setRetrievalTimeInMs(end.getTime() - start.getTime());
            asset.setStatusCode(statusCode);
            asset.setReportedMimeType(reportedMimeType);
            //####TODO: Set other stuff here
           
            result = new AssetWithContent(asset, get.getResponseBodyAsStream());
        }
        catch (RuntimeException re)
        {
            throw re;
        }
View Full Code Here

Examples of net.sf.sitstart.svc.internal.AssetWithContent

    /**
     * @see net.sf.sitstart.svc.internal.AssetRetriever#retrieve(java.net.URI, boolean)
     */
    public AssetWithContent retrieve(URI uri, boolean isRoot)
    {
        AssetWithContent result = null;
       
        // PRECONDITIONS
        assert uri != null : "uri must not be null.";
       
        // Body
        result = new AssetWithContent(factory.create(uri, isRoot), null);
       
        return(result);
    }
View Full Code Here

Examples of net.sf.sitstart.svc.internal.AssetWithContent

    /**
     * @see net.sf.sitstart.svc.internal.AssetRetriever#retrieve(java.net.URI, boolean)
     */
    public AssetWithContent retrieve(URI uri, boolean isRoot)
    {
        AssetWithContent result = null;
       
        // PRECONDITIONS
        assert uri != null : "uri must not be null.";
       
        // Body
        result = new AssetWithContent(dao.getByURI(uri), null);
       
        return(result);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.