public static IModuleDependencyRefset importModuleDependencyRefset(
            Set<InputStream> refsetFiles) throws ImportException {

        Set<ModuleDependencyRow> members = new HashSet<ModuleDependencyRow>();
        for(InputStream refsetFile : refsetFiles) {
            BufferedReader br = null;
            try {
                br = new BufferedReader(new InputStreamReader(refsetFile));
                String line = br.readLine();

                String[] cols = line.split("[\t]");
                assert(cols.length >= 6);

                // Test if it is a module dependency refset
                if (cols.length == 8
                        && cols[6].equals("sourceEffectiveTime")
                        && cols[7].equals("targetEffectiveTime")) {

                    while (null != (line = br.readLine())) {
                        cols = line.split("[\t]");
                        boolean active = cols[2].equals("1");
                        ModuleDependencyRow m =
                                new ModuleDependencyRow(cols[0],
                                        cols[1], active , cols[3], cols[4],
                                        cols[5], cols[6], cols[7]);
                        members.add(m);
                    }
                } else {
                    throw new ImportException("Malformed module dependency reference set with " + cols.length + " columns "+Arrays.asList(cols));
                }
            } catch (IOException e) {
                log.error("Problem reading refset file "+refsetFile, e);
                throw new ImportException("Problem reading refset file ", e);
            } finally {
                if(br != null) {
                    try { br.close(); } catch(Exception e) {}
                }
            }
        }

        try {
            return new ModuleDependencyRefset(members, !Boolean.getBoolean("mdrs.ignoreErrors"));
        } catch (ValidationException e) {
            throw new ImportException("Can not continue import with invalid MDRS", e);
        }
    }
public static IModuleDependencyRefset importModuleDependencyRefset ( Set < InputStream > refsetFiles ) throws ImportException { Set < ModuleDependencyRow > members = new HashSet < ModuleDependencyRow > ( ) ; for ( InputStream refsetFile : refsetFiles ) { BufferedReader br = null ; try { br = new BufferedReader ( new InputStreamReader ( refsetFile ) ) ; String line = br . readLine ( ) ; String [ ] cols = line . split ( "[\t]" ) ; assert ( cols . length >= 6 ) ; if ( cols . length == 8 && cols [ 6 ] . equals ( "sourceEffectiveTime" ) && cols [ 7 ] . equals ( "targetEffectiveTime" ) ) { while ( null != ( line = br . readLine ( ) ) ) { cols = line . split ( "[\t]" ) ; boolean active = cols [ 2 ] . equals ( "1" ) ; ModuleDependencyRow m = new ModuleDependencyRow ( cols [ 0 ] , cols [ 1 ] , active , cols [ 3 ] , cols [ 4 ] , cols [ 5 ] , cols [ 6 ] , cols [ 7 ] ) ; members . add ( m ) ; } } else { throw new ImportException ( "Malformed module dependency reference set with " + cols . length + " columns " + Arrays . asList ( cols ) ) ; } } catch ( IOException e ) { log . error ( "Problem reading refset file " + refsetFile , e ) ; throw new ImportException ( "Problem reading refset file " , e ) ; } finally { if ( br != null ) { try { br . close ( ) ; } catch ( Exception e ) { } } } } try { return new ModuleDependencyRefset ( members , ! Boolean . getBoolean ( "mdrs.ignoreErrors" ) ) ; } catch ( ValidationException e ) { throw new ImportException ( "Can not continue import with invalid MDRS" , e ) ; } }
Imports a module dependency reference set from a {@link Set} of
{@link InputStream}s. This method closes the {@link InputStream}s after
loading the reference sets.
@param report

@param refsetFiles The input streams.
@return
@throws ImportException