Changeset 61e4e2a for core


Ignore:
Timestamp:
Mar 3, 2017 1:59:54 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
5f96067
Parents:
b6952930
Message:

Util: Don't depend on DataHelper? in FileUtil?.copy(),
causes Windows installer to fail because DataHelper? is not in install.jar.
tag i2p-0.9.29-win1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/FileUtil.java

    rb6952930 r61e4e2a  
    1919import java.util.zip.ZipFile;
    2020
     21// WARNING
     22// Some methods called from install.jar (Windows installer utils)
     23// or InstallUpdate (i2pupdate.zip installer),
     24// where most external classes are not available, including DataHelper!
     25// Use caution when adding dependencies.
    2126import net.i2p.data.DataHelper;
    2227
     
    459464            in = new FileInputStream(src);
    460465            out = new FileOutputStream(dst);
    461             DataHelper.copy(in, out);
     466            // We do NOT use DataHelper.copy() because it's used in installer.jar
     467            // which does not contain DataHelper
     468            //DataHelper.copy(in, out);
     469            int read;
     470            byte buf[] = new byte[4096];
     471            while ((read = in.read(buf)) != -1) {
     472                out.write(buf, 0, read);
     473            }
    462474            return true;
    463475        } catch (IOException ioe) {
Note: See TracChangeset for help on using the changeset viewer.