// Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
//     public ProxyResolutionException(Exception e) {
//         super(e);
//     }
// 
//     public ProxyResolutionException(String message) {
//         super(message);
//     }
// 
//     public ProxyResolutionException(String message, Exception e) {
//         super(message, e);
//     }
// }


import org.firepick.firebom.exception.ProxyResolutionException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
package org.firepick.firebom.part;
/*
   HtmlPart.java
   Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */



public class HtmlPart extends Part {
    protected static final Pattern startTitle = Pattern.compile("<title>");
    protected static final Pattern endTitle = Pattern.compile("</title>");

    public HtmlPart(PartFactory partFactory, URL url, CachedUrlResolver urlResolver) {
        super(partFactory, url, urlResolver);
    }

    @Override
    protected void refreshFromRemoteContent(String content) throws IOException {
        setId("UNSUPPORTED");
        setTitle("Unsupported FireBOM vendor http://bit.ly/16jPAOr");
        String[] ulParts = content.split("</ul>");
        List<String> newSourceList = null;
        PartUsage newSourcePartUsage = null;
        List<PartUsage> newRequiredParts = null;
        for (String ulPart : ulParts) {
            if (ulPart.contains("@Source")) {
                newSourceList = parseListItemStrings(ulPart);
                if (newSourceList.size() == 0) {
// Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
//     public ProxyResolutionException(Exception e) {
//         super(e);
//     }
// 
//     public ProxyResolutionException(String message) {
//         super(message);
//     }
// 
//     public ProxyResolutionException(String message, Exception e) {
//         super(message, e);
//     }
// }


// Path: src/main/java/org/firepick/firebom/part/HtmlPart.java
import org.firepick.firebom.exception.ProxyResolutionException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

package org.firepick.firebom.part;
/*
   HtmlPart.java
   Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */



public class HtmlPart extends Part {
    protected static final Pattern startTitle = Pattern.compile("<title>");
    protected static final Pattern endTitle = Pattern.compile("</title>");

    public HtmlPart(PartFactory partFactory, URL url, CachedUrlResolver urlResolver) {
        super(partFactory, url, urlResolver);
    }

    @Override
    protected void refreshFromRemoteContent(String content) throws IOException {
        setId("UNSUPPORTED");
        setTitle("Unsupported FireBOM vendor http://bit.ly/16jPAOr");
        String[] ulParts = content.split("</ul>");
        List<String> newSourceList = null;
        PartUsage newSourcePartUsage = null;
        List<PartUsage> newRequiredParts = null;
        for (String ulPart : ulParts) {
            if (ulPart.contains("@Source")) {
                newSourceList = parseListItemStrings(ulPart);
                if (newSourceList.size() == 0) {
                    throw new ProxyResolutionException("Html page has no @Sources tag");