Changeset 7168
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/util/Values.java
r6898 r7168 601 601 } 602 602 603 p rivatestatic final long GB = 1073741824;604 p rivatestatic final long MB = 1048576;605 p rivatestatic final long kB = 1024;603 public static final long GB = 1073741824; 604 public static final long MB = 1048576; 605 public static final long kB = 1024; 606 606 607 607 /** -
trunk/src/plugins/core/net/sf/basedb/plugins/PackedFileExporter.java
r6520 r7168 42 42 import net.sf.basedb.core.ProgressReporter; 43 43 import net.sf.basedb.core.RequestInformation; 44 import net.sf.basedb.core.SimpleAbsoluteProgressReporter; 44 45 import net.sf.basedb.core.StringParameterType; 45 46 import net.sf.basedb.core.Job.ExecutionTime; … … 56 57 import net.sf.basedb.core.signal.SignalTarget; 57 58 import net.sf.basedb.core.signal.ThreadSignalHandler; 59 import net.sf.basedb.util.ChainedProgressReporter; 58 60 import net.sf.basedb.util.FileUtil; 61 import net.sf.basedb.util.ProgressInputStream; 59 62 import net.sf.basedb.util.Values; 60 63 import net.sf.basedb.util.zip.FilePacker; … … 357 360 FilePacker packer = getPacker(); 358 361 362 ChainedProgressReporter chained = null; 359 363 if (progress != null) 360 364 { 361 365 progress.display(0, "Checking selected files and directories..."); 366 chained = new ChainedProgressReporter(progress); 362 367 } 363 368 … … 414 419 currentFile + " of " + numFiles + " file(s) (" + 415 420 Values.formatBytes(completedBytes) + " of " + Values.formatBytes(totalBytes) + ")"); 421 422 if (in != null && size > Values.MB) 423 { 424 // Wrap in ProgressInputStream so we get progress reporting while the packer is working 425 chained.setRange(percent, (int)((size+completedBytes)*progressFactor)); 426 427 // Progress message template '@' is replaced with actual bytes read 428 final String msgTemplate = 429 "Compressing '" + entryPath + "' (@ of " + Values.formatBytes(size) + ")"; 430 431 in = new ProgressInputStream(in, new SimpleAbsoluteProgressReporter(chained, size)) 432 { 433 @Override 434 protected void progressReport(String msg) 435 { 436 super.progressReport(msgTemplate.replace("@", msg)); 437 } 438 }; 439 } 416 440 } 417 441
Note: See TracChangeset
for help on using the changeset viewer.