Project

General

Profile

« Previous | Next » 

Revision 1293

Added by Jing Tao over 22 years ago

Add a control for readForRemoteServer is only for data file.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
1281 1281
   // Create a object of RemoteDocument, "" is for zipEntryPath
1282 1282
   RemoteDocument remoteDoc = 
1283 1283
                        new RemoteDocument (docid, rev,user, password, "");
1284
   // If it is zip format
1285
   if (zip)
1284
   String docType = remoteDoc.getDocType();
1285
   // Only read data file
1286
   if (docType.equals("BIN"))
1286 1287
   {
1287
     remoteDoc.readDocumentFromRemoteServerByZip(zout);
1288
   }//if 
1288
    // If it is zip format
1289
    if (zip)
1290
    {
1291
      remoteDoc.readDocumentFromRemoteServerByZip(zout);
1292
    }//if 
1293
    else
1294
    {
1295
      if (out == null)
1296
      {
1297
        out = response.getOutputStream();
1298
      }//if
1299
      response.setContentType("application/octet-stream");
1300
      remoteDoc.readDocumentFromRemoteServer(out);
1301
    }//else (not zip)
1302
   }//if doctype=bin 
1289 1303
   else
1290 1304
   {
1291
     if (out == null)
1292
     {
1293
       out = response.getOutputStream();
1294
     }//if
1295
     response.setContentType("application/octet-stream");
1296
     remoteDoc.readDocumentFromRemoteServer(out);
1297
   }//else (not zip)                   
1305
     throw new Exception("Docid: "+docid+"."+rev+" couldn't find");
1306
   }//else                 
1298 1307
 }//readFromRemoteMetaCat
1299 1308
  
1300 1309
  // END OF READ SECTION

Also available in: Unified diff