User Tools

Site Tools


A java class to get a compressed file from the server

Some guys often ask me to help them to get some files from the server, such as tomcat log. Everytime I must open ftp client to connect the server, download these file. The lazy man need a smart way to do this job. Now they can help themselves.

 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 public class ZGet {
     public void get(HttpServletRequest request, HttpServletResponse response, String filename) {
         try {
             // String fname = request.getParameter("xpath");
             fname = filename;
             File f = new File(fname);
             if (f.canRead()) {
                 response.setHeader("Location", f.getName());  
                 response.setHeader("Content-Disposition", "attachment; filename=" + f.getName() + ".gz");
                 get(new FileInputStream(filename), response.getOutputStream());
          } catch (Exception e) {
              // TODO Auto-generated catch block
      private void get(InputStream in, OutputStream out) throws IOException {
          if (in == null || out == null) {
          byte[] buffer = new byte[1024];
          int i = -1;
          GZIPOutputStream gzip = new GZIPOutputStream(out);
          while ((i = != -1) {
              gzip.write(buffer, 0, i);


, AXBLMHFZYBu, 2012/01/06 02:37

This is a rellay intelligent way to answer the question.

, 2019/03/27 01:58 QQQ

,, 2019/04/19 20:05 - Buy Amoxicillin Online <a href=“”>Amoxicillin 500 Mg</a>

,, 2019/04/19 21:22 - Amoxicillin 500mg Capsules <a href=“”>Amoxicillin 500mg Capsules</a>

, 2019/10/10 11:13

Garage, 26, is one <a href=>kd shoes</a> of the largest child, dell - garage in 2002, the dad announced over 07 years of career, finally handed over 40. 2% on threes report card. From a quite young age, Stephen about the shooting learned how to shoot for the feet of the get better at, when dad refused to consider him to the hornets teaching, Stephen will be pursed mouth, not because can't visit those big-name players, the old you happen to be, but because he also desire to be with my dad, to practice his shot.

At age 9, garage is of her own <a href=>stephen curry shoes</a> amateur league teams associated with players, only if the coach must outside shot collapse for the opponent's zone will always be sent. Recalled the yourself, garage proudly said: “when My spouse and i was a defense gurus, all start from presently there. ”

To go here we are at <a href=>curry shoes</a> the original text, if your garage near the baseball in midfield, people tend to overlook the most important thing: pool soccer ball skills. Sonya, thanks in order to his mother, then any 5 feet tall 3, cordial and some stubborn woman again as well, she was in secondary school played point guard, looking towards the volleyball after into the campus of Virginia technological, and meet the car port there's father. “If I dribble towards coast, I have to pick to shoot or go, it's my limit. “Dell mentioned, “people started for Stephen impression is all they can beautiful posture hit photographs, but before becoming any striker, he already was an improved control player, people have a tendency to ignore it. After their dribble shot, is I the most wonderful moments. Thanks to his or her mother. ”.

Tag: <a href=>kyrie irving shoes</a> <a href=>nike huarache</a> <a href=>Nike CR7</a> <a href=>kobe 10</a> <a href=>kyrie irving jersey</a> <a href=>puma fenty</a> <a href=>adidas yeezy</a> <a href=>air jordan shoes</a> <a href=>michael jordan shoes</a> <a href=>jordan retro</a> <a href=>kobe 11</a> <a href=>kyrie 4 halloween</a> <a href=>air jordan 32</a> <a href=>john wall shoes</a> <a href=>kobe shoes</a> <a href=>kobe bryant jersey</a> <a href=>adidas shoes</a> <a href=>birkenstock</a> <a href=>kyrie 4</a> <a href=>adidas zx flux</a> <a href=>adidas nmd shoes</a> <a href=>kyrie 2</a> <a href=>nike vapormax shoes</a> <a href=>nike zoom vaporfly elite</a> <a href=>ultra boost 4.0</a> <a href=>nike epic react</a> <a href=>yeezy boost</a> <a href=>under armour shoes</a> <a href=>Nike Soccer Cleats</a> <a href=>nike mercurial</a> <a href=>soldier 11</a> <a href=>lebron 14 shoes</a> <a href=>kd 11</a> <a href=>kyrie 4</a> <a href=>nike hyperdunk</a> <a href=>kyrie 3</a> <a href=>kd 10</a> <a href=>stephen curry jersey</a> <a href=>nike kyrie shoes</a> <a href=>lebron james shoes</a> <a href=>puma suede</a> <a href=>kyrie 4</a> <a href=>air max 270</a> <a href=>kyrie 3</a> <a href=>nike air max 97</a> <a href=>curry 2</a> <a href=>kevin durant shoes</a> <a href=>lebron james shoes</a> <a href=>kyrie 4 halloween</a> <a href=>ultra boost shoes</a> <a href=>nike air more uptempo</a> <a href=>kyrie shoes 3</a> <a href=>lebron shoes</a> <a href=>stephen curry shoes</a> <a href=>kyrie irving shoes</a> <a href=>adidas ultra boost uncaged</a> <a href=>curry 5</a> <a href=>nike air vapormax</a> <a href=>Nike Lebron James Shoes</a> <a href=>kd 11 shoes</a> <a href=>kevin durant jersey</a> <a href=>curry 5</a> <a href=>lebron soldier 10</a> <a href=>puma fenty slides</a> <a href=>nike air presto</a> <a href=>puma fenty</a> <a href=>nike zoom vaporfly</a> <a href=>kd shoes</a> <a href=>calvin klein</a> <a href=>kyrie 2 shoes</a> <a href=>kyrie 1</a> <a href=>curry 5</a> <a href=>yeezy boost</a> <a href=>kyrie 4</a> <a href=>vans sk8 hi</a> <a href=>puma rihanna creepers</a> <a href=>yeezy shoes</a> <a href=>nike pg 2</a> <a href=>mizuno running shoes</a> <a href=>asics gel kayano 23</a> <a href=>adidas soccer cleats</a> <a href=>lebron soldier 10</a> <a href=>paul george shoes</a> <a href=>lebron 14 shoes</a> <a href=>nike kobe shoes</a> <a href=>nike sock racer</a>

Enter your comment. Wiki syntax is allowed:
mirnshi/a_java_class_to_get_a_compressed_file_from_the_server.txt · Last modified: 2009/12/19 05:22 by mirnshi