Package com.pugh.sockso.web

Examples of com.pugh.sockso.web.Request


     *
     */
   
    protected void showBurp() throws IOException, SQLException {
       
        final Request req = getRequest();
        final Response res = getResponse();

        final TBurp tpl = new TBurp();
        tpl.setHost( req.getHeader("Host") );
        tpl.setReferer( req.getHeader("Referer") );
        tpl.setException( e );
        tpl.setMessage( e.getMessage() );
        tpl.setShowStackTrace( showStackTrace );
        tpl.setStatusCode( e.getStatusCode() );
       
View Full Code Here


     *
     */
   
    public void handleRequest() throws SQLException, IOException, BadRequestException {
       
        final Request req = getRequest();
        final String type = req.getUrlParam( 1 );
       
        if ( type.equals("latest") )
            latest( getLatestTracks(20) );
       
        else throw new BadRequestException( "Unknown feed type (" + type + ")", 400 );
View Full Code Here

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

        final Request req = getRequest();
        final String type = req.getUrlParam( 1 );

        if ( type.equals("playlist"))
            playlist();

        else throw new BadRequestException( "unknown browse type '" + type + "'", 400 );
View Full Code Here

     *
     */
   
    protected void playlist() throws SQLException, IOException, BadRequestException {
       
        final Request req = getRequest();
        final Database db = getDatabase();
        final int id = Integer.parseInt( req.getUrlParam(2)  );       
        final Playlist playlist = Playlist.find( db, id );
       
        if ( playlist == null ) {
            throw new BadRequestException( "Invalid playlist ID", 404 );
        }
View Full Code Here

     *
     */
   
    public void handleRequest() throws IOException, SQLException, BadRequestException {
      
        final Request req = getRequest();
        final String[] playArgs = req.getPlayParams( true );
        final String type = req.getUrlParam( 1 );
        final TracksRequest tracksRequest = new TracksRequest( req, getDatabase(), getProperties() );

        if ( type.equals( "html5" )) {
            showHtml5Player(
                req.getUrlParam( 2 ).equals( "random" )
                    ? tracksRequest.getRandomTracks()
                    : tracksRequest.getRequestedTracks(),
                req.getUrlParam( 2 ).equals( "random" )
            );
        }
               
        else if(type.equals( "jplayer")) {
          showJplayer(
                req.getUrlParam( 2 ).equals( "random" )
                    ? tracksRequest.getRandomTracks()
                    : tracksRequest.getRequestedTracks(),
                req.getUrlParam( 2 ).equals( "random" )
            );
        }
       
        // default to XSPF player
        else {
       
            String extraArgs = "";

            if ( req.hasArgument("orderBy") ) {
                extraArgs += "&orderBy=" +req.getArgument("orderBy");
            }
           
            if ( req.hasArgument("path") ) {
                extraArgs += "&path=" + Utils.URLEncode(req.getArgument("path") );
            }

            showXspfPlayer( getXspfPlayer(), extraArgs, playArgs );

        }
View Full Code Here

     *
     */
   
    protected XspfPlayer getXspfPlayer() {
       
        final Request req = getRequest();
        final String player = req.getArgument( "player" );
       
        // use flex player?
        if ( player.equals("flexPlayer") )
            return new TFlexPlayer();
       
View Full Code Here

     *
     */

    public void handleRequest() throws IOException {

        final Request req = getRequest();
        final String[] playArgs = req.getPlayParams( false );

        showSharePage( playArgs );

    }
View Full Code Here

     */
   
    @Override
    public void handleRequest() throws IOException, SQLException {
       
        final Request req = getRequest();
       
        String letter = req.getUrlParam(2);
        if ( !letter.equals("") )
            letter = letter.substring(0,1).toLowerCase();

        showByLetter( letter, getArtistsByLetter(letter) );
       
View Full Code Here

     */
   
    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Request req = getRequest();
        final int id = Integer.parseInt( req.getUrlParam(2)  );
        final Album album = getAlbum ( id );
        final List<Track> tracks = getAlbumTracks( id );
       
        showAlbum( album, tracks );
       
View Full Code Here

     */
   
    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Request req = getRequest();
        final int id = Integer.parseInt( req.getUrlParam(2)  );
        final Artist artist = getArtist( id );
        final List<Album> albums = getArtistAlbums( id );
       
        showArtist( artist, albums );
       
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.