本文整理汇总了Java中java.io.IOException.hasMoreElements方法的典型用法代码示例。如果您正苦于以下问题:Java IOException.hasMoreElements方法的具体用法?Java IOException.hasMoreElements怎么用?Java IOException.hasMoreElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.IOException
的用法示例。
在下文中一共展示了IOException.hasMoreElements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: regressionDefaults
import java.io.IOException; //导入方法依赖的package包/类
public static Option regressionDefaults() {
Properties props = new Properties();
try (InputStream is = TestConfiguration.class.getResourceAsStream("/osgi.properties")) {
props.load(is);
} catch (IOException e) {
throw new RuntimeException(e);
}
List<Option> options = new ArrayList<>();
for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements();) {
String k = (String) e.nextElement();
options.add(CoreOptions.frameworkProperty(k).value(props.getProperty(k)));
options.add(CoreOptions.systemProperty(k).value(props.getProperty(k)));
}
return composite(
// Framework
composite(options.toArray(new Option[options.size()])),
// Logging
mvnBundle("org.slf4j", "slf4j-api"),
mvnBundle("ch.qos.logback", "logback-core"),
mvnBundle("ch.qos.logback", "logback-classic"),
mvnBundle("org.jboss.logging", "jboss-logging"),
// Set logback configuration via system property.
// This way, both the driver and the container use the same configuration
systemProperty("logback.configurationFile").value(
"file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml"),
// JUnit
junitBundles(),
mvnBundle("org.mockito", "mockito-all"),
// Config Admin
mvnBundle("org.apache.felix", "org.apache.felix.configadmin")
);
}
示例2: extract
import java.io.IOException; //导入方法依赖的package包/类
/**
* fileName���� ���� package �������� ������ ������
*/
public void extract() {
try {
zipFile = new ZipFile(file);
}catch( IOException e ) {
e.printStackTrace();
}
//ZipEntry���� �̸��� ��ü�� �ҷ����δ�
for( Enumeration e=zipFile.entries(); e.hasMoreElements(); ) {
ZipEntry entry = (ZipEntry)e.nextElement();
String fullName = entry.getName();
//.class �� ������ file�� ����Ѵ�
if( fullName.endsWith(".class") == true ) {
int index = fullName.lastIndexOf( "/" );
String pathname = fullName.substring( 0, index );
String className = fullName.substring( index+1 );
String packageName = pathname.replace('/', '.');
String superPackageName = (packageName.indexOf(".") != -1) ? packageName.substring(0, packageName.lastIndexOf(".")) : null;
if(superPackageName != null){
PackageInfo superPackageInfo = pContainer.getPackageInfo(superPackageName);
if(superPackageInfo == null){
superPackageInfo = new PackageInfo();
superPackageInfo.setName(superPackageName);
pContainer.addPackageInfo(superPackageInfo);
}
superPackageInfo.addChildPackageName(packageName.substring(packageName.lastIndexOf(".")+1));
}
//������ ���� PackageInfo ��ü�� ������ classInfo ��ü�� �߰��ϰ�
//������ PackageInfo ��ü�� ���� ���� �߰��Ѵ�
PackageInfo currPackageInfo = pContainer.getPackageInfo( packageName );
if( currPackageInfo == null ) {
currPackageInfo = new PackageInfo();
currPackageInfo.setName( packageName );
currPackageInfo.addClassName( className );
pContainer.addPackageInfo( currPackageInfo );
}else {
currPackageInfo.addClassName( className );
}
}
}
}