< prev index next >

src/java.base/share/classes/sun/net/www/MimeLauncher.java

Print this page




  99             extension = filename.substring(dot);
 100         }
 101 
 102         filename = "HJ" + url.hashCode();
 103 
 104         tempFilename = prefix + filename + timestamp + extension + suffix;
 105 
 106         return tempFilename;
 107     }
 108 
 109     public void run() {
 110         try {
 111             String ofn = m.getTempFileTemplate();
 112             if (ofn == null) {
 113                 ofn = genericTempFileTemplate;
 114             }
 115 
 116             ofn = getTempFileName(uc.getURL(), ofn);
 117             try {
 118                 OutputStream os = new FileOutputStream(ofn);
 119                 byte buf[] = new byte[2048];
 120                 int i = 0;
 121                 try {
 122                     while ((i = is.read(buf)) >= 0) {
 123                         os.write(buf, 0, i);
 124                     }
 125                 } catch(IOException e) {
 126                   //System.err.println("Exception in write loop " + i);
 127                   //e.printStackTrace();
 128                 } finally {
 129                     os.close();
 130                     is.close();
 131                 }
 132             } catch(IOException e) {
 133               //System.err.println("Exception in input or output stream");
 134               //e.printStackTrace();
 135             }
 136 
 137             int inx = 0;
 138             String c = execPath;
 139             while ((inx = c.indexOf("%t")) >= 0) {




  99             extension = filename.substring(dot);
 100         }
 101 
 102         filename = "HJ" + url.hashCode();
 103 
 104         tempFilename = prefix + filename + timestamp + extension + suffix;
 105 
 106         return tempFilename;
 107     }
 108 
 109     public void run() {
 110         try {
 111             String ofn = m.getTempFileTemplate();
 112             if (ofn == null) {
 113                 ofn = genericTempFileTemplate;
 114             }
 115 
 116             ofn = getTempFileName(uc.getURL(), ofn);
 117             try {
 118                 OutputStream os = new FileOutputStream(ofn);
 119                 byte[] buf = new byte[2048];
 120                 int i = 0;
 121                 try {
 122                     while ((i = is.read(buf)) >= 0) {
 123                         os.write(buf, 0, i);
 124                     }
 125                 } catch(IOException e) {
 126                   //System.err.println("Exception in write loop " + i);
 127                   //e.printStackTrace();
 128                 } finally {
 129                     os.close();
 130                     is.close();
 131                 }
 132             } catch(IOException e) {
 133               //System.err.println("Exception in input or output stream");
 134               //e.printStackTrace();
 135             }
 136 
 137             int inx = 0;
 138             String c = execPath;
 139             while ((inx = c.indexOf("%t")) >= 0) {


< prev index next >