Changeset 4c02c1f


Ignore:
Timestamp:
Feb 25, 2018 2:20:44 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
27042f9
Parents:
79baf70
Message:

JettyStart?: Cleanup, replace Resource with File

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/jetty/java/src/net/i2p/jetty/JettyStart.java

    r79baf70 r4c02c1f  
    1919// ========================================================================
    2020
     21import java.io.File;
     22import java.io.FileInputStream;
    2123import java.io.InputStream;
    2224import java.net.URL;
     
    3739import org.eclipse.jetty.server.Server;
    3840import org.eclipse.jetty.util.component.LifeCycle;
    39 import org.eclipse.jetty.util.resource.Resource;
    4041import org.eclipse.jetty.xml.XmlConfiguration;
    4142
     
    5556    private final String[] _args;
    5657    private final List<LifeCycle> _jettys;
     58    // warning, may be null if called from main
    5759    private final I2PAppContext _context;
    5860    private volatile ClientAppState _state;
     
    8385        Properties properties=new Properties();
    8486        XmlConfiguration last=null;
    85         Resource r = null;
    8687        for (int i = 0; i < args.length; i++) {
     88            File f = new File(args[i]);
    8789            if (args[i].toLowerCase().endsWith(".properties")) {
     90                InputStream in = null;
    8891                try {
    89                     r = Resource.newResource(args[i]);
    90                     properties.load(r.getInputStream());
     92                    in = new FileInputStream(f);
     93                    properties.load(in);
    9194                } finally {
    92                     if (r != null) r.close();
     95                    if (in != null) try { in.close(); } catch (IOException ioe) {}
    9396                }
    9497            } else {
    95                 URL configUrl;
    96                 try {
    97                     r = Resource.newResource(args[i]);
    98                     configUrl = r.getURL();
    99                 } finally {
    100                     if (r != null) r.close();
    101                 }
     98                URL configUrl = f.toURI().toURL();
    10299                XmlConfiguration configuration = new XmlConfiguration(configUrl);
    103100                if (last!=null)
Note: See TracChangeset for help on using the changeset viewer.