當前位置: 首頁>>代碼示例>>Java>>正文


Java IOException.nextElement方法代碼示例

本文整理匯總了Java中java.io.IOException.nextElement方法的典型用法代碼示例。如果您正苦於以下問題:Java IOException.nextElement方法的具體用法?Java IOException.nextElement怎麽用?Java IOException.nextElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.IOException的用法示例。


在下文中一共展示了IOException.nextElement方法的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.nextElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。