Esempio n. 1
0
 @Override
 public Value link(DataHandler h, int tabId) {
   if (fileName == null) {
     this.tableId = tabId;
     return this;
   }
   if (linked) {
     ValueLob copy = ValueLob.copy(this);
     copy.objectId = getNewObjectId(h);
     copy.tableId = tabId;
     String live = getFileName(h, copy.tableId, copy.objectId);
     copyFileTo(h, fileName, live);
     copy.fileName = live;
     copy.linked = true;
     return copy;
   }
   if (!linked) {
     this.tableId = tabId;
     String live = getFileName(h, tableId, objectId);
     if (tempFile != null) {
       tempFile.stopAutoDelete();
       tempFile = null;
     }
     renameFile(h, fileName, live);
     fileName = live;
     linked = true;
   }
   return this;
 }