Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 58792 Details for
Bug 173907
[code assist] severe NPE on exception completions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Test case
MapFileGenerator.java (text/plain), 2.25 KB, created by
Olivier Thomann
on 2007-02-12 14:09:21 EST
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-02-12 14:09:21 EST
Size:
2.25 KB
patch
obsolete
>package org.eclipse.internal.orbit; > >import java.io.*; >import java.util.regex.Matcher; >import java.util.regex.Pattern; > >public class MapFileGenerator { > File root; > > String username; > > String pwd; > > String addressPrefix; > > String inputFile; > > String outpuFile; > > public void execute() { > BufferedReader reader = null; > BufferedWriter writer = null; > try { > try { > reader = new BufferedReader(new FileReader(inputFile)); > writer = new BufferedWriter(new FileWriter(outpuFile)); > Pattern replacementExpression = Pattern > .compile("^([a-zA-Z0-9\\-.]*)_?([0-9]*\\.[0-9]*\\.[0-9]*)?=(.*)$"); > Matcher m = null; > String current = null; > while ((current = reader.readLine()) != null) { > m = replacementExpression.matcher(current); > m.matches(); > if (!m.matches()) > continue; > String fileName = m.group(1) + "_" + m.group(3); > boolean isJar = isJar(fileName); > writer.write("bundle@" + m.group(1) + (m.group(2) == null ? "" : m.group(2)) + "=GET," > + addressPrefix + fileName + (isJar ? ".jar" : ".zip,unpack=true") > + (username == null ? "" : ',' + username) + (pwd == null ? "" : ',' + pwd) + '\n'); > } > } finally { > if (writer != null) > writer.close(); > if (reader != null) > reader.close(); > } > } catch (IO e) { > } > } > > private boolean isJar(String path) { > File checked = new File(root, path + ".jar"); > if (checked.exists()) > return true; > return false; > } > > public static void main(String[] args) { > MapFileGenerator mfg = new MapFileGenerator(); > mfg.root = new File("d:/foo"); > mfg.addressPrefix = "http://eclipse.org/"; > mfg.inputFile = "D:\\pdeBuildTutorial\\BuildPlace\\finalPluginsVersions.properties"; > mfg.outpuFile = "d:\\tmp\\map.txt"; > mfg.execute(); > } > > public void setRoot(File root) { > this.root = root; > } > > public void setUsername(String username) { > this.username = username; > } > > public void setPwd(String pwd) { > this.pwd = pwd; > } > > public void setAddressPrefix(String addressPrefix) { > this.addressPrefix = addressPrefix; > } > > public void setInputFile(String inputFile) { > this.inputFile = inputFile; > } > > public void setOutpuFile(String outpuFile) { > this.outpuFile = outpuFile; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 173907
: 58792 |
58796