当前位置: 首页>>代码示例>>Java>>正文


Java IOException.hasMoreElements方法代码示例

本文整理汇总了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")
    );
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:33,代码来源:TestConfiguration.java

示例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 );
      }
    }
  }
}
 
开发者ID:FJplant,项目名称:AntIDE,代码行数:54,代码来源:FileExtractor.java


注:本文中的java.io.IOException.hasMoreElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。