import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class Config
{
private static Properties p = new Properties();
static
{
InputStream is = null;
try
{
is = Config.class.getClassLoader().getResourceAsStream("Config.properties");
if (is != null)
{
p.load(is);
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (is != null)
{
try
{
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
public static String get(String key)
{
return p.getProperty(key);
}
public static String getRepository()
{
return p.getProperty("REPOSITORY");
}
import java.io.InputStream;
import java.util.Properties;
public class Config
{
private static Properties p = new Properties();
static
{
InputStream is = null;
try
{
is = Config.class.getClassLoader().getResourceAsStream("Config.properties");
if (is != null)
{
p.load(is);
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (is != null)
{
try
{
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
public static String get(String key)
{
return p.getProperty(key);
}
public static String getRepository()
{
return p.getProperty("REPOSITORY");
}
}
Config.properties:
REPOSITORY=E:/file/