tds/src/main/java/thredds/server/reify/DownloadController.java
public void doonce(HttpServletRequest req)
            throws SendError
    {
        if(once)
            return;
        super.initOnce(req);
        if(this.downloaddir == null)
            throw new SendError(HttpStatus.SC_PRECONDITION_FAILED, "Download disabled");
        this.downloaddirname = new File(this.downloaddir).getName();

        // Get the download form
        File downform = null;
        downform = tdsContext.getDownloadForm();
        if(downform == null) {   // Look in WEB-INF directory
            File root = tdsContext.getServletRootDirectory();
            downform = new File(root, DEFAULTDOWNLOADFORM);
        }
        try {
            this.downloadform = loadForm(downform);
        } catch (IOException ioe) {
            throw new SendError(HttpStatus.SC_PRECONDITION_FAILED, ioe);
        }
    }
public void doonce(HttpServletRequest req)
            throws SendError
    {
        if(once)
            return;
        super.initOnce(req);
        if(this.downloaddir == null)
            throw new SendError(HttpStatus.SC_PRECONDITION_FAILED, "Download disabled");
        this.downloaddirname = new File(this.downloaddir).getName();

        // Get the download form
        File downform = null;
        downform = tdsContext.getDownloadForm();
        if(downform == null) {   // Look in WEB-INF directory
            File root = tdsContext.getServletRootDirectory();
            downform = new File(root, DEFAULTDOWNLOADFORM);
        }
        try {
            this.downloadform = loadForm(downform);
        } catch (IOException ioe) {
            throw new SendError(HttpStatus.SC_PRECONDITION_FAILED, ioe);
        }
    }
public void doonce ( HttpServletRequest req ) throws SendError { if ( once ) return ; super . initOnce ( req ) ; if ( this . downloaddir == null ) throw new SendError ( HttpStatus . SC_PRECONDITION_FAILED , "Download disabled" ) ; this . downloaddirname = new File ( this . downloaddir ) . getName ( ) ; // Get the download form File downform = null ; downform = tdsContext . getDownloadForm ( ) ; if ( downform == null ) { // Look in WEB-INF directory File root = tdsContext . getServletRootDirectory ( ) ; downform = new File ( root , DEFAULTDOWNLOADFORM ) ; } try { this . downloadform = loadForm ( downform ) ; } catch ( IOException ioe ) { throw new SendError ( HttpStatus . SC_PRECONDITION_FAILED , ioe ) ; } }
Invoked once on first request so that everything is available,
especially Spring stuff.
Invoked once on first request so that everything is available especially Spring stuff .