You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Roy Russo <ro...@jboss.com> on 2004/12/14 00:49:00 UTC

putmethod on gif from resource

Hi folks,

I' been trying to get the following code to put a gif file in to the store. 
For some reason, it'll create the index.html file, create the images 
directory and it does place the image in the store. However, the image is 
corrupted. Am I doing this correctly?

    public void createDefaultData(String sSlideRoot) {
        try {
            URL urlIndex = getClass().getResource(DEFAULT_DATA_PATH + 
"/index.html");
            wdResource.putMethod("/slide" + sSlideRoot + "/index.html", 
urlIndex); // index page

            wdResource.mkcolMethod("/slide" + sSlideRoot + "/images"); // 
images dir

            URL urlLogo = getClass().getResource(DEFAULT_DATA_PATH + 
"/jbportal_logo.gif");
            wdResource.setContentType("image/gif");
            wdResource.putMethod("/slide" + sSlideRoot + 
"/images/jbportal_logo.gif", urlLogo); // logo.gif
        } catch (HttpException httpe) {
            httpe.printStackTrace();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }

DAVExplorer shows everything in place, but the problem is the image isn't 
any good when the putmethod is done. No exceptions are thrown and the 
putMethod returns true. Any help is appreciated.

Roy Russo
JBoss Portal Developer



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org