opendap/src/main/java/opendap/servlet/AbstractServlet.java
public void doGetASC(ReqState rs) throws Exception {
    if (Debug.isSet("showResponse")) {
      log.debug("doGetASC For: " + rs.getDataSet());
    }

    GuardedDataset ds = null;
    try {
      ds = getDataset(rs);
      if (ds == null) return;

      rs.getResponse().setHeader("XDODS-Server", getServerVersion());
      rs.getResponse().setContentType("text/plain");
      rs.getResponse().setHeader("Content-Description", "dods-ascii");

      if (debug)
        log.debug("Sending OPeNDAP ASCII Data For: " + rs + "  CE: '" + rs.getConstraintExpression() + "'");

      ServerDDS dds = ds.getDDS();
      //dds = url.getData(ce, null, new asciiFactory());  previous way

      // Instantiate the CEEvaluator and parse the constraint expression
      CEEvaluator ce = new CEEvaluator(dds);

      // i think this makes the dds constrained
      ce.parseConstraint(rs);

      PrintWriter pw = new PrintWriter(new OutputStreamWriter(rs.getResponse().getOutputStream(), Util.UTF8));
      dds.printConstrained(pw);
      pw.println("---------------------------------------------");


      AsciiWriter writer = new AsciiWriter(); // could be static
      writer.toASCII(pw, dds, ds);


      // the way that getDAP2Data works
      // DataOutputStream sink = new DataOutputStream(bOut);
      // ce.send(myDDS.getName(), sink, ds);

      pw.flush();

      rs.getResponse().setStatus(HttpServletResponse.SC_OK);

    } catch (ParseException pe) {
      parseExceptionHandler(pe, rs.getResponse());
    } catch (DAP2Exception de) {
      dap2ExceptionHandler(de, rs.getResponse());
    } catch (Throwable t) {
      anyExceptionHandler(t, rs);
    } finally { // release lock if needed
      if (ds != null) ds.release();
    }

  }
public void doGetASC(ReqState rs) throws Exception {
    if (Debug.isSet("showResponse")) {
      log.debug("doGetASC For: " + rs.getDataSet());
    }

    GuardedDataset ds = null;
    try {
      ds = getDataset(rs);
      if (ds == null) return;

      rs.getResponse().setHeader("XDODS-Server", getServerVersion());
      rs.getResponse().setContentType("text/plain");
      rs.getResponse().setHeader("Content-Description", "dods-ascii");

      if (debug)
        log.debug("Sending OPeNDAP ASCII Data For: " + rs + "  CE: '" + rs.getConstraintExpression() + "'");

      ServerDDS dds = ds.getDDS();
      //dds = url.getData(ce, null, new asciiFactory());  previous way

      // Instantiate the CEEvaluator and parse the constraint expression
      CEEvaluator ce = new CEEvaluator(dds);

      // i think this makes the dds constrained
      ce.parseConstraint(rs);

      PrintWriter pw = new PrintWriter(new OutputStreamWriter(rs.getResponse().getOutputStream(), Util.UTF8));
      dds.printConstrained(pw);
      pw.println("---------------------------------------------");


      AsciiWriter writer = new AsciiWriter(); // could be static
      writer.toASCII(pw, dds, ds);


      // the way that getDAP2Data works
      // DataOutputStream sink = new DataOutputStream(bOut);
      // ce.send(myDDS.getName(), sink, ds);

      pw.flush();

      rs.getResponse().setStatus(HttpServletResponse.SC_OK);

    } catch (ParseException pe) {
      parseExceptionHandler(pe, rs.getResponse());
    } catch (DAP2Exception de) {
      dap2ExceptionHandler(de, rs.getResponse());
    } catch (Throwable t) {
      anyExceptionHandler(t, rs);
    } finally { // release lock if needed
      if (ds != null) ds.release();
    }

  }
public void doGetASC ( ReqState rs ) throws Exception { if ( Debug . isSet ( "showResponse" ) ) { log . debug ( "doGetASC For: " + rs . getDataSet ( ) ) ; } GuardedDataset ds = null ; try { ds = getDataset ( rs ) ; if ( ds == null ) return ; rs . getResponse ( ) . setHeader ( "XDODS-Server" , getServerVersion ( ) ) ; rs . getResponse ( ) . setContentType ( "text/plain" ) ; rs . getResponse ( ) . setHeader ( "Content-Description" , "dods-ascii" ) ; if ( debug ) log . debug ( "Sending OPeNDAP ASCII Data For: " + rs + "  CE: '" + rs . getConstraintExpression ( ) + "'" ) ; ServerDDS dds = ds . getDDS ( ) ; //dds = url.getData(ce, null, new asciiFactory());  previous way // Instantiate the CEEvaluator and parse the constraint expression CEEvaluator ce = new CEEvaluator ( dds ) ; // i think this makes the dds constrained ce . parseConstraint ( rs ) ; PrintWriter pw = new PrintWriter ( new OutputStreamWriter ( rs . getResponse ( ) . getOutputStream ( ) , Util . UTF8 ) ) ; dds . printConstrained ( pw ) ; pw . println ( "---------------------------------------------" ) ; AsciiWriter writer = new AsciiWriter ( ) ; // could be static writer . toASCII ( pw , dds , ds ) ; // the way that getDAP2Data works // DataOutputStream sink = new DataOutputStream(bOut); // ce.send(myDDS.getName(), sink, ds); pw . flush ( ) ; rs . getResponse ( ) . setStatus ( HttpServletResponse . SC_OK ) ; } catch ( ParseException pe ) { parseExceptionHandler ( pe , rs . getResponse ( ) ) ; } catch ( DAP2Exception de ) { dap2ExceptionHandler ( de , rs . getResponse ( ) ) ; } catch ( Throwable t ) { anyExceptionHandler ( t , rs ) ; } finally { // release lock if needed if ( ds != null ) ds . release ( ) ; } }
************************************************************************
Default handler for OPeNDAP ascii data requests. Returns the request data as
a comma delimited ascii file. Note that this means that the more complex
OPeNDAP structures such as Grids get flattened...
<p/>
<p/>
Modified 2/8/07 jcaron to not make a DConnect2 call to itself

@param rs the decoded Request State
************************************************************************ Default handler for OPeNDAP ascii data requests . Returns the request data as a comma delimited ascii file . Note that this means that the more complex OPeNDAP structures such as Grids get flattened ... <p / > <p / > Modified 2 / 8 / 07 jcaron to not make a DConnect2 call to itself