Examples of Download


Examples of br.com.caelum.vraptor.interceptor.download.Download

  interceptor = new DownloadInterceptor(response, info, result);
  }

  @Test
  public void whenResultIsADownloadShouldUseIt() throws Exception {
    Download download = mock(Download.class);

    when(info.getResult()).thenReturn(download);

    interceptor.intercept(stack, resourceMethod, null);
View Full Code Here

Examples of cfdict.downloader.Download

        try {
            Config config = new Config("config/config.properties");
            System.out.println("[MODE " + config.getMode() + "]");
           
            Download dl = new Download(config);
            dl.process();
            Decompress dp = new Decompress(config);
            dp.process();
            Parser p = new Parser(config);
            Generator g;
            if (config.getMode().equals("INSERT"))
View Full Code Here

Examples of com.atlauncher.data.Download

                    Node node = nodeList.item(i);
                    if (node.getNodeType() == Node.ELEMENT_NODE) {
                        Element element = (Element) node;
                        String url = element.getAttribute("url");
                        String file = element.getAttribute("file");
                        Download download = Download.direct;
                        if (element.hasAttribute("download")) {
                            download = Download.valueOf(element.getAttribute("download"));
                        }
                        String md5 = "-";
                        if (element.hasAttribute("md5")) {
View Full Code Here

Examples of com.jpoweredcart.common.entity.catalog.Download

    return getJdbcOperations().query(query.getSql(),
        query.getParameters(), new DownloadRowMapper(){
          @Override
          public Download mapRow(ResultSet rs, int rowNum)
              throws SQLException {
            Download download = super.mapRow(rs, rowNum);
            download.setName(rs.getString("name"));
            return download;
          }
    }.setTargetClass(Download.class));
  }
View Full Code Here

Examples of dijjer.io.download.Download

    OutputStream tos = new TruncatingOutputStream(out,
        DownloadHandler.INITIAL_SNIFF_BYTES
            + (_rangeStart % Store.DATA_BLOCK_SIZE),
        (_rangeEnd - _rangeStart) + 1
            - DownloadHandler.INITIAL_SNIFF_BYTES);
    Download dl = new Download(_reqUrl, _length, _lastModified, startBlock,
        endBlock, tos);
    long startTime = System.currentTimeMillis();
    dl.start();
    long totalTime = System.currentTimeMillis() - startTime;
    String actualMD5 = out.getMD5Sum();
    String correctMD5 = downloadMd5();
    synchronized (recentDownloads) {
      while (recentDownloads.size() >= MAX_RECENT_DOWNLOADS) {
        recentDownloads.removeLast();
      }
      StringBuffer rd = new StringBuffer(200);
      rd.append("<tr>");
      rd.append("<td>"
          + _reqUrl.toString().substring(
              _reqUrl.toString().lastIndexOf("/") + 1,
              _reqUrl.toString().length()) + "</td>");
      rd.append("<td>" + (_length / 1024) + "</td>");
      rd
          .append("<td>"
              + ((int) ((1000f * (float) dl.getDownloaded()) / (1024f * (float) totalTime)))
              + "</td>");
      String md5Colour;
      if (correctMD5 == null) {
        md5Colour = "#000000";
      } else {
        if (correctMD5.equalsIgnoreCase(actualMD5)) {
          md5Colour = "#00FF00";
        } else {
          md5Colour = "#FF0000";
          Logger.warning("File " + _reqUrl + " failed MD5Sum check!");
        }
      }
      rd.append("<td><font color=\"" + md5Colour + "\">" + actualMD5
          + "</font></td>");
      rd.append("<td>"
          + Math.min(100, (dl.getBytesFromCache() * 100)
              / dl.getDownloaded()) + "</td>");
      rd.append("</tr>");
      recentDownloads.addFirst(rd.toString());
    }
  }
View Full Code Here

Examples of kz.sysdesign.app.Entities.Download

   */
  @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
View Full Code Here

Examples of nextapp.echo2.app.filetransfer.Download

        return outputStream.toByteArray();
    }
   
    public Download getPdfDownload(boolean activate) throws NamingException, EJbsObject, Exception, IOException {
        final byte[] pdf = this.createPdf();
        Download download = new Download();
        download.setProvider(new AbstractDownloadProvider() {

            private static final long serialVersionUID = 1L;

            public String getContentType() {
                return "application/pdf";
            }

            public String getFileName() {
                return "dunnings.pdf";
            }

            public void writeFile(OutputStream stream) throws IOException {
                stream.write(pdf);
                try {
                    setDunningsPrinted();
                } catch (Exception e) {
                    logger.error("Error downloading report.", e);
               }

            }
        });
        download.setActive(activate);
        return download;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.Download

      // prevents someone without the hash from downloading the torrent
   
    try{
      byte[]  search_key = ((DDBaseKeyImpl)key).getBytes();
     
      Download   download = null;
       
      PluginInterface pi = PluginInitializer.getDefaultInterface();
                 
      String  search_sha1 = pi.getUtilities().getFormatters().encodeBytesToString( search_key );
     
      if ( ta_sha1 == null ){
       
        ta_sha1 = pi.getTorrentManager().getPluginAttribute( "DDBaseTTTorrent::sha1");
      }
       
        // gotta look for the sha1(hash)
     
      Download[]  downloads = pi.getDownloadManager().getDownloads();
     
      for (int i=0;i<downloads.length;i++){
       
        Download  dl = downloads[i];
       
        if ( dl.getTorrent() == null ){
         
          continue;
        }
       
        String  sha1 = dl.getAttribute( ta_sha1 );
       
        if ( sha1 == null ){
         
          sha1 = pi.getUtilities().getFormatters().encodeBytesToString(
                new SHA1Simple().calculateHash( dl.getTorrent().getHash()));
         
          dl.setAttribute( ta_sha1, sha1 );
        }
       
        if ( sha1.equals( search_sha1 )){
         
          download  = dl;
                   
          break;
        }
      }
       
      if ( download == null ){
       
        synchronized( this ){
         
          if ( external_downloads != null ){
           
            for (int i=0;i<external_downloads.size();i++){
             
              Download  dl = (Download)external_downloads.get(i);
             
              if ( dl.getTorrent() == null ){
               
                continue;
              }
             
              String  sha1 = dl.getAttribute( ta_sha1 );
             
              if ( sha1 == null ){
               
                sha1 = pi.getUtilities().getFormatters().encodeBytesToString(
                      new SHA1Simple().calculateHash( dl.getTorrent().getHash()));
               
                dl.setAttribute( ta_sha1, sha1 );
              }
             
              if ( sha1.equals( search_sha1 )){
               
                download  = dl;
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.Download

      ShareItem  item = (ShareItem)items.get(i);
       
        try{
        Torrent  t = item.getTorrent();
                  
        Download  download = dm.getDownload( t );
       
        if ( download == null ){
                   
          continue;
        }
       
        int  dl_state = download.getState();
       
        if (   dl_state == Download.ST_ERROR ){
         
        }else if ( dl_state != Download.ST_STOPPED ){
         
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.Download

          try{
            Torrent  t = item.getTorrent();
           
            TrackerTorrent  tracker_torrent = tracker.getTorrent( t );
           
            Download  download = dm.getDownload( t );
           
            if ( tracker_torrent == null || download == null ){
                             
              continue;
            }
           
            int  dl_state = download.getState();
           
            if (   dl_state == Download.ST_ERROR ){
             
            }else if ( dl_state != Download.ST_STOPPED ){
             
              if ( do_stop ){
               
                try{
                  download.stop();
                }catch( Throwable e ){
                }
               
                try{
                  tracker_torrent.stop();
                }catch( Throwable e ){
                }
              }
             
            }else{
             
              if ( !do_stop ){
               
                try{
                  download.restart();
                }catch( Throwable e ){
                }
               
                try{
                  tracker_torrent.start();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.