Package com.pugh.sockso.web

Examples of com.pugh.sockso.web.Request


    }

    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Request req = getRequest();
        final String type = req.getUrlParam( 1 );

        if ( type.equals("random") ) {
            createRandomPlaylist();
        }
View Full Code Here


public class XspferTest extends PlaylistTestCase {
   
    public void testShowXspf() throws Exception {
       
        final Request req = createNiceMock( Request.class );
       
        final Server s = createNiceMock( Server.class );
       
        final TestResponse res = new TestResponse();
        final TXspf tpl = new TXspf();
View Full Code Here

    }
   
    public void testTracksSpecifedByIdAreIncludedInPlaylist() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/tr1/tr3 HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

       
    }

    public void testAllTracksFromAlbumsSpecifedByIdAreIncludedInPlaylist() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/al1 HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

    public void testTracksThatMatchPathSpecifiedAreIncludedInPlaylist() throws Exception {
       
        p.set( Constants.WWW_BROWSE_FOLDERS_ENABLED, p.YES );
       
        Request req = new TestRequest( "GET /xspf/?path=/music/folder HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

    }
   
    public void testTracksNotReturnedByPathWhenFolderBrowsingNotEnabled() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/?path=/music/folder HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertNotContains( res.getOutput(), "First Track" );
View Full Code Here

    private void showBurp( final int statusCode, final String referer, final String expectContains ) throws Exception {
       
        final TestResponse res = new TestResponse();
        final BadRequestException e = new BadRequestException( "something", statusCode );

        final Request req = createMock( Request.class );
        expect( req.getHeader("Host") ).andReturn( "localhost" );
        expect( req.getHeader("Referer") ).andReturn( referer );
        replay( req );
       
        final Errorer err = new Errorer( e, false );
        err.setRequest( req );
        err.setResponse( res );
View Full Code Here

     *
     */

    public void handleRequest() throws Exception {

        final Request req = getRequest();
        final String itemName = req.getUrlParam( 2 );
       
        for ( final CovererPlugin plugin : plugins ) {

            plugin.setRequest( getRequest() );
            plugin.setResponse( getResponse() );
View Full Code Here

     *
     */
   
    public void handleRequest() throws SQLException, IOException, BadRequestException {

        final Request req = getRequest();
        final Response res = getResponse();
        final Locale locale = getLocale();
        final Properties p = getProperties();

        if ( p.get(Constants.WWW_DOWNLOADS_DISABLE).equals(Properties.YES) )
            throw new BadRequestException( locale.getString("www.error.downloadsDisabled"), 403 );
       
        final Database db = getDatabase();
        final String[] args = req.getPlayParams( false );
        final List<Track> tracks = Track.getTracksFromPlayArgs( db, args );
        final String fileName = getFileName( tracks );

        res.addHeader( "Content-length", Long.toString(getContentLength(tracks)) );
        res.addHeader( "Content-type", "application/zip" );
View Full Code Here

     *
     */
   
    public void handleRequest() throws IOException, BadRequestException {

        final Request req = getRequest();
        final String type = req.getUrlParam( 1 );
       
        if ( type.equals("test") )
            sendTestResponse();
        else
            throw new BadRequestException( "unknown command", 400 );
View Full Code Here

TOP

Related Classes of com.pugh.sockso.web.Request

Copyright © 2018 www.massapicom. 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.