Package kz.sysdesign.app.Entities

Examples of kz.sysdesign.app.Entities.Track


    public Track getTrackByChecksum(String checksum)
    {
        String jpqlQuery = "FROM " + Track.class.getSimpleName() + " t WHERE t.md5checksum = :checksum";
        Query query = em.createQuery(jpqlQuery, Track.class).setParameter("checksum", checksum);

        Track link = null;
        try
        {
            link = (Track) query.getSingleResult();
        }
        catch(NonUniqueResultException ue) {  }
View Full Code Here


      {
        Album album = albumDAO.getAlbumByName(albumName);
        albumList = new ArrayList<Album>();
        albumList.add(album);
      }
      Track track = new Track(trackName, artist, albumList, year);
      trackCreated = trackDAO.addTrack(track);
    }
    catch(NonUniqueResultException ue) {  }
    catch(NoResultException ne) {  }
    catch(RuntimeException re) {  }
View Full Code Here

   * @return initiates track download and redirects to browse page
   */
  @RequestMapping(value = "/download", method = RequestMethod.GET)
  public String getFile(@RequestParam("checksum") String checksum, HttpServletResponse response)
  {
    Track track = trackService.getTrackByChecksum(checksum);
    Download download = new Download(track);
    trackService.addDownload(download);

    String link = track.getLink();
    // To avoid any legal issues copyright protected material isn't being kept locally,
    // instead link to file will be replaced by a free sample audio file
    link = "audio.wma";

    // Forces the track to be downloaded, not played
View Full Code Here

TOP

Related Classes of kz.sysdesign.app.Entities.Track

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.