This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 212068
Collapse All | Expand All

(-)a/autoupdate.services/apichanges.xml (+16 lines)
Lines 57-62 Link Here
57
    <!-- ACTUAL CHANGES BEGIN HERE: -->
57
    <!-- ACTUAL CHANGES BEGIN HERE: -->
58
58
59
    <changes>
59
    <changes>
60
        <change id="nbm-external-size">
61
            <api name="general"/>
62
            <summary>Allowing to specify external NBM content size</summary>
63
            <version major="1" minor="31"/>
64
            <date day="11" month="5" year="2012"/>
65
            <author login="jlahoda"/>
66
            <compatibility addition="yes" />
67
            <description>
68
                <p>
69
                    You can now specify the size of the external NBM content in the <code>.external</code> file
70
                    by using <code>SIZE:</code> property (e.g. <code>SIZE:42</code>). The size will then be incorporated
71
                    in the download size of the NBM.
72
                </p>
73
            </description>
74
            <issue number="212068"/>
75
        </change>
60
        <change id="nbm-external">
76
        <change id="nbm-external">
61
            <api name="general"/>
77
            <api name="general"/>
62
            <summary>External NBM contents</summary>
78
            <summary>External NBM contents</summary>
(-)a/autoupdate.services/manifest.mf (-1 / +1 lines)
Lines 1-7 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.autoupdate.services
2
OpenIDE-Module: org.netbeans.modules.autoupdate.services
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/autoupdate/services/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/autoupdate/services/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.30
4
OpenIDE-Module-Specification-Version: 1.31
5
OpenIDE-Module-Layer: org/netbeans/modules/autoupdate/services/resources/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/autoupdate/services/resources/layer.xml
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Essential-Module: true
7
AutoUpdate-Essential-Module: true
(-)a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java (-2 / +5 lines)
Lines 761-766 Link Here
761
                                    }
761
                                    }
762
                                    check.update(arr, 0, len);
762
                                    check.update(arr, 0, len);
763
                                    fos.write(arr, 0, len);
763
                                    fos.write(arr, 0, len);
764
                                    assert progressRunning;
765
                                    if ((c += len) <= toUpdateImpl.getDownloadSize())
766
                                        progress.progress(aggregateDownload + c);
764
                                }
767
                                }
765
                            } finally {
768
                            } finally {
766
                                fos.close();
769
                                fos.close();
Lines 789-795 Link Here
789
            throw new OperationException (OperationException.ERROR_TYPE.PROXY, source.toString ());
792
            throw new OperationException (OperationException.ERROR_TYPE.PROXY, source.toString ());
790
        }
793
        }
791
        
794
        
792
        return c;
795
        return toUpdateImpl.getDownloadSize();
793
    }
796
    }
794
797
795
    private int doValidate (OperationInfo info, ProgressHandle progress, final int verified) throws OperationException {
798
    private int doValidate (OperationInfo info, ProgressHandle progress, final int verified) throws OperationException {
Lines 1041-1047 Link Here
1041
1044
1042
        LOG.log (Level.FINE, "Destination " + dest + " is successfully wrote. Size " + dest.length());
1045
        LOG.log (Level.FINE, "Destination " + dest + " is successfully wrote. Size " + dest.length());
1043
        
1046
        
1044
        return estimatedSize;
1047
        return increment;
1045
    }
1048
    }
1046
    
1049
    
1047
    private int verifyNbm (UpdateElement el, File nbmFile, ProgressHandle progress, int verified) throws OperationException {
1050
    private int verifyNbm (UpdateElement el, File nbmFile, ProgressHandle progress, int verified) throws OperationException {
(-)a/libs.findbugs/release/modules/ext/asm-3.3.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:845117826
1
CRC:845117826
2
SIZE:43578
2
URL:m2:/asm:asm:3.3:jar
3
URL:m2:/asm:asm:3.3:jar
3
URL:http://repo1.maven.org/maven2/asm/asm/3.3/asm-3.3.jar
4
URL:http://repo1.maven.org/maven2/asm/asm/3.3/asm-3.3.jar
(-)a/libs.findbugs/release/modules/ext/asm-commons-3.3.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:3706373490
1
CRC:3706373490
2
SIZE:38275
2
URL:m2:/asm:asm-commons:3.3:jar
3
URL:m2:/asm:asm-commons:3.3:jar
3
URL:http://repo1.maven.org/maven2/asm/asm-commons/3.3/asm-commons-3.3.jar
4
URL:http://repo1.maven.org/maven2/asm/asm-commons/3.3/asm-commons-3.3.jar
(-)a/libs.findbugs/release/modules/ext/asm-tree-3.3.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:2123946967
1
CRC:2123946967
2
SIZE:21503
2
URL:m2:/asm:asm-tree:3.3:jar
3
URL:m2:/asm:asm-tree:3.3:jar
3
URL:http://repo1.maven.org/maven2/asm/asm-tree/3.3/asm-tree-3.3.jar
4
URL:http://repo1.maven.org/maven2/asm/asm-tree/3.3/asm-tree-3.3.jar
(-)a/libs.findbugs/release/modules/ext/bcel-2.0.0.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:3232663152
1
CRC:3232663152
2
SIZE:583778
2
URL:m2:/com.google.code.findbugs:bcel:2.0.0:jar
3
URL:m2:/com.google.code.findbugs:bcel:2.0.0:jar
3
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/bcel/2.0.0/bcel-2.0.0.jar
4
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/bcel/2.0.0/bcel-2.0.0.jar
(-)a/libs.findbugs/release/modules/ext/commons-lang-2.4.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:2462627153
1
CRC:2462627153
2
SIZE:261809
2
URL:m2:/commons-lang:commons-lang:2.4:jar
3
URL:m2:/commons-lang:commons-lang:2.4:jar
3
URL:http://repo1.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
4
URL:http://repo1.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
(-)a/libs.findbugs/release/modules/ext/dom4j-1.6.1.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:2050839146
1
CRC:2050839146
2
SIZE:313898
2
URL:m2:/dom4j:dom4j:1.6.1:jar
3
URL:m2:/dom4j:dom4j:1.6.1:jar
3
URL:http://repo1.maven.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
4
URL:http://repo1.maven.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
(-)a/libs.findbugs/release/modules/ext/findbugs-2.0.0.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:2356748666
1
CRC:2356748666
2
SIZE:3409389
2
URL:m2:/com.google.code.findbugs:findbugs:2.0.0:jar
3
URL:m2:/com.google.code.findbugs:findbugs:2.0.0:jar
3
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/findbugs/2.0.0/findbugs-2.0.0.jar
4
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/findbugs/2.0.0/findbugs-2.0.0.jar
(-)a/libs.findbugs/release/modules/ext/jFormatString-2.0.0.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:3491364031
1
CRC:3491364031
2
SIZE:27271
2
URL:m2:/com.google.code.findbugs:jFormatString:2.0.0:jar
3
URL:m2:/com.google.code.findbugs:jFormatString:2.0.0:jar
3
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/jFormatString/2.0.0/jFormatString-2.0.0.jar
4
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/jFormatString/2.0.0/jFormatString-2.0.0.jar
(-)a/libs.findbugs/release/modules/ext/jaxen-1.1.1.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:409387958
1
CRC:409387958
2
SIZE:226915
2
URL:m2:/jaxen:jaxen:1.1.1:jar
3
URL:m2:/jaxen:jaxen:1.1.1:jar
3
URL:http://repo1.maven.org/maven2/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar
4
URL:http://repo1.maven.org/maven2/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar
(-)a/libs.findbugs/release/modules/ext/jsr305-2.0.0.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:2447033994
1
CRC:2447033994
2
SIZE:31866
2
URL:m2:/com.google.code.findbugs:jsr305:2.0.0:jar
3
URL:m2:/com.google.code.findbugs:jsr305:2.0.0:jar
3
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/2.0.0/jsr305-2.0.0.jar
4
URL:http://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/2.0.0/jsr305-2.0.0.jar
(-)a/libs.junit4/release/modules/ext/junit-4.10.jar.external (+1 lines)
Lines 1-3 Link Here
1
CRC:3480621823
1
CRC:3480621823
2
SIZE:253160
2
URL:m2:/junit:junit:4.10:jar
3
URL:m2:/junit:junit:4.10:jar
3
URL:http://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar
4
URL:http://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar
(-)a/nbbuild/antsrc/org/netbeans/nbbuild/AutoUpdate.java (-1 / +1 lines)
Lines 394-400 Link Here
394
    }
394
    }
395
    
395
    
396
    private InputStream externalDownload(InputStream is, AtomicLong crc) throws IOException {
396
    private InputStream externalDownload(InputStream is, AtomicLong crc) throws IOException {
397
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
397
        BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
398
        URLConnection conn;
398
        URLConnection conn;
399
        crc.set(-1L);
399
        crc.set(-1L);
400
        for (;;) {
400
        for (;;) {
(-)a/nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java (-1 / +32 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.nbbuild;
45
package org.netbeans.nbbuild;
46
46
47
import java.io.BufferedReader;
47
import java.util.HashMap;
48
import java.util.HashMap;
48
import java.util.LinkedHashMap;
49
import java.util.LinkedHashMap;
49
import java.util.Map;
50
import java.util.Map;
Lines 57-62 Link Here
57
import java.io.FileOutputStream;
58
import java.io.FileOutputStream;
58
import java.io.IOException;
59
import java.io.IOException;
59
import java.io.InputStream;
60
import java.io.InputStream;
61
import java.io.InputStreamReader;
60
import java.io.OutputStream;
62
import java.io.OutputStream;
61
import java.io.OutputStreamWriter;
63
import java.io.OutputStreamWriter;
62
import java.io.PrintWriter;
64
import java.io.PrintWriter;
Lines 67-78 Link Here
67
import java.util.Collection;
69
import java.util.Collection;
68
import java.util.Comparator;
70
import java.util.Comparator;
69
import java.util.Date;
71
import java.util.Date;
72
import java.util.Enumeration;
70
import java.util.List;
73
import java.util.List;
71
import java.util.Properties;
74
import java.util.Properties;
72
import java.util.TimeZone;
75
import java.util.TimeZone;
73
import java.util.TreeMap;
76
import java.util.TreeMap;
74
import java.util.TreeSet;
77
import java.util.TreeSet;
75
import java.util.jar.Attributes;
78
import java.util.jar.Attributes;
79
import java.util.jar.JarEntry;
76
import java.util.jar.JarFile;
80
import java.util.jar.JarFile;
77
import java.util.regex.Matcher;
81
import java.util.regex.Matcher;
78
import java.util.regex.Pattern;
82
import java.util.regex.Pattern;
Lines 380-386 Link Here
380
                    for (Module m : entry.getValue()) {
384
                    for (Module m : entry.getValue()) {
381
                        Element module = m.xml;
385
                        Element module = m.xml;
382
                        if (module.getAttribute("downloadsize").equals("0")) {
386
                        if (module.getAttribute("downloadsize").equals("0")) {
383
                            module.setAttribute("downloadsize", Long.toString(m.nbm.length()));
387
                            module.setAttribute("downloadsize", Long.toString(m.nbm.length() + m.externalDownloadSize));
384
                        }
388
                        }
385
                        Element manifest = (Element) module.getElementsByTagName("manifest").item(0);
389
                        Element manifest = (Element) module.getElementsByTagName("manifest").item(0);
386
                        String name = manifest.getAttribute("OpenIDE-Module-Name");
390
                        String name = manifest.getAttribute("OpenIDE-Module-Name");
Lines 462-467 Link Here
462
        public File nbm;
466
        public File nbm;
463
        public String relativePath;
467
        public String relativePath;
464
        public boolean autoload, eager;
468
        public boolean autoload, eager;
469
        public long externalDownloadSize;
465
    }
470
    }
466
471
467
    private void writeNotification(PrintWriter pw) {
472
    private void writeNotification(PrintWriter pw) {
Lines 596-601 Link Here
596
                                    }
601
                                    }
597
                                }
602
                                }
598
                            }
603
                            }
604
                            Enumeration<JarEntry> en = jar.entries();
605
                            while (en.hasMoreElements()) {
606
                                JarEntry e = en.nextElement();
607
                                if (e.getName().endsWith(".external")) {
608
                                    InputStream eStream = jar.getInputStream(e);
609
                                    try {
610
                                        m.externalDownloadSize += externalSize(eStream);
611
                                    } finally {
612
                                        eStream.close();
613
                                    }
614
                                }
615
                            }
599
                            moduleCollection.add(m);
616
                            moduleCollection.add(m);
600
                        } finally {
617
                        } finally {
601
                            jar.close();
618
                            jar.close();
Lines 611-616 Link Here
611
        return r;
628
        return r;
612
    }
629
    }
613
630
631
    private long externalSize(InputStream is) throws IOException {
632
        BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
633
        for (;;) {
634
            String line = br.readLine();
635
            if (line == null) {
636
                break;
637
            }
638
            if (line.startsWith("SIZE:")) {
639
                return Long.parseLong(line.substring(5).trim());
640
            }
641
        }
642
        return 0;
643
    }
644
    
614
    /**
645
    /**
615
     * Create the equivalent of {@code Info/info.xml} for an OSGi bundle.
646
     * Create the equivalent of {@code Info/info.xml} for an OSGi bundle.
616
     * @param jar a bundle
647
     * @param jar a bundle

Return to bug 212068