* i2psnark:

- Don't filter create torrent form, and
     fix exception on ':' in file names (ticket #1342)
   - Don't remap file names on torrents we created, and
     save remap setting in torrent config file (tickets #571, 771)
   - Escaping fixes since names may not be remapped
   - Use better encodePath() from Jetty
   - Don't say create torrent succeeded when it didn't
   - Add more sanity checks for torrent creation
This commit is contained in:
zzz
2014-08-19 20:34:46 +00:00
parent 66bbe21a87
commit 33b7f08d5c
11 changed files with 419 additions and 61 deletions

View File

@@ -420,14 +420,17 @@ public class Snark
try
{
activity = "Checking storage";
boolean shouldPreserve = completeListener != null && completeListener.getSavedPreserveNamesSetting(this);
if (baseFile == null) {
String base = Storage.filterName(meta.getName());
String base = meta.getName();
if (!shouldPreserve)
base = Storage.filterName(base);
if (_util.getFilesPublic())
baseFile = new File(rootDataDir, base);
else
baseFile = new SecureFile(rootDataDir, base);
}
storage = new Storage(_util, baseFile, meta, slistener);
storage = new Storage(_util, baseFile, meta, slistener, shouldPreserve);
if (completeListener != null) {
storage.check(completeListener.getSavedTorrentTime(this),
completeListener.getSavedTorrentBitField(this));
@@ -1141,7 +1144,7 @@ public class Snark
else
baseFile = new SecureFile(rootDataDir, base);
// The following two may throw IOE...
storage = new Storage(_util, baseFile, metainfo, this);
storage = new Storage(_util, baseFile, metainfo, this, false);
storage.check();
// ... so don't set meta until here
meta = metainfo;