mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/osgi/BundleManagementMessageService.java
public List<String> parseImportExportHeaders(final String headerValue)
    {
        final List<String> answers = new ArrayList<String>();
        
        boolean foundBeginningQuote = false;
        int beginningPos = 0;
        
        for (int i = 0; i < headerValue.length(); i++)
        {
            if (headerValue.charAt(i) == ',' && !foundBeginningQuote)
            {
                final String aPackage = headerValue.substring(beginningPos, i);
                beginningPos = i + 1;
                answers.add(aPackage);
            }
            else if (headerValue.charAt(i) == '"' && !foundBeginningQuote)
            {
                foundBeginningQuote = true;
            }
            else if (headerValue.charAt(i) == '"' && foundBeginningQuote)
            {
                foundBeginningQuote = false;
            }
        }
        
        //add an empty string if no packages are present.
        if (beginningPos != headerValue.length())
        {
            //make sure not to drop the last package 
            answers.add(headerValue.substring(beginningPos, headerValue.length()));
        }
        
        return answers;
    }
/**
     * Function which parses a passed in import/export header. Function looks
     * for ',' that are not inside of '"' and breaks the string at that point.
     * @param headerValue
     *  the string value of the import or export header
     * @return
     *  if the string is empty then this function will return a list of size 1
     *  that has the empty string as its only entry. if there are packages in the
     *  string, then the list will contain the packages found.
     */
Function which parses a passed in import/export header. Function looks
for ',' that are not inside of '"' and breaks the string at that point.
@param headerValue
the string value of the import or export header
@return
if the string is empty then this function will return a list of size 1
that has the empty string as its only entry. if there are packages in the
string, then the list will contain the packages found.
Function which parses a passed in import / export header . Function looks for ' ' that are not inside of ' " ' and breaks the string at that point . @param headerValue the string value of the import or export header @return if the string is empty then this function will return a list of size 1 that has the empty string as its only entry . if there are packages in the string then the list will contain the packages found .
public List<String> parseImportExportHeaders(final String headerValue)
    {
        final List<String> answers = new ArrayList<String>();
        boolean foundBeginningQuote = false;
        int beginningPos = 0;
        for (int i = 0; i < headerValue.length(); i++)
        {
            if (headerValue.charAt(i) == ',' && !foundBeginningQuote)
            {
                final String aPackage = headerValue.substring(beginningPos, i);
                beginningPos = i + 1;
                answers.add(aPackage);
            }
            else if (headerValue.charAt(i) == '"' && !foundBeginningQuote)
            {
                foundBeginningQuote = true;
            }
            else if (headerValue.charAt(i) == '"' && foundBeginningQuote)
            {
                foundBeginningQuote = false;
            }
        }
        if (beginningPos != headerValue.length())
        {
            answers.add(headerValue.substring(beginningPos, headerValue.length()));
        }
        return answers;
    }
public List < String > parseImportExportHeaders ( final String headerValue ) { final List < String > answers = new ArrayList < String > ( ) ; boolean foundBeginningQuote = false ; int beginningPos = 0 ; for ( int i = 0 ; i < headerValue . length ( ) ; i ++ ) { if ( headerValue . charAt ( i ) == ',' && ! foundBeginningQuote ) { final String aPackage = headerValue . substring ( beginningPos , i ) ; beginningPos = i + 1 ; answers . add ( aPackage ) ; } else if ( headerValue . charAt ( i ) == '"' && ! foundBeginningQuote ) { foundBeginningQuote = true ; } else if ( headerValue . charAt ( i ) == '"' && foundBeginningQuote ) { foundBeginningQuote = false ; } } if ( beginningPos != headerValue . length ( ) ) { answers . add ( headerValue . substring ( beginningPos , headerValue . length ( ) ) ) ; } return answers ; }
Function which parses a passed in import/export header.
Function which parses a passed in import / export header .
//add an empty string if no packages are present. //make sure not to drop the last package 