[
https://issues.jboss.org/browse/JBIDE-18411?page=com.atlassian.jira.plugi...
]
Rob Stryker commented on JBIDE-18411:
-------------------------------------
sounds like the API is assuming alot about the sequence on how things
works.
The API was reviewed by various consumers and modified repeatedly for newer usecases.
Nobody seemed to have a problem previously with passing in a name to use.
tell me what happens if the url does not have any valid filenames in
it ?
Not exactly sure what you mean here, but, the download-runtime dialog takes the url and
tries to get a name from it.
http://blah.net/file/jboss-as-distribution-6.0.0.Final.zip/download would be saved as
"download"
http://blah.net/file/jboss-as-distribution-6.0.0.Final.zip would be saved as
jboss-as-distribution-6.0.0.Final.zip.
http://blah.net/file/jboss-as-distribution-6.0.0.Final.zip?use_mirror=aut... would be
saved as jboss-as-distribution-6.0.0.Final.zip.
It basically takes the last segment of the path ignoring other attributes passed in.
DownloadRuntimesWizard shouldn't need to parse the d/l url to
infer the file name
---------------------------------------------------------------------------------
Key: JBIDE-18411
URL:
https://issues.jboss.org/browse/JBIDE-18411
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: runtime-detection
Affects Versions: 4.2.0.CR1
Environment: JBT 4.2.0.CR1, JBDS 8.0.0.CR1
Reporter: Radim Hopp
Assignee: Rob Stryker
Fix For: 4.3.0.Alpha1
JBIDE-18393 showed that parsing d/l urls was fragile :
{noformat:title=An internal error occurred during: "Download 'JBoss
6.0.0".}java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1954)
at
org.jboss.tools.runtime.ui.internal.wizard.DownloadRuntimeOperationUtility.getNextUnusedFilename(DownloadRuntimeOperationUtility.java:56)
at
org.jboss.tools.runtime.ui.internal.wizard.DownloadRuntimeOperationUtility.getDestinationFile(DownloadRuntimeOperationUtility.java:89)
at
org.jboss.tools.runtime.ui.internal.wizard.DownloadRuntimeOperationUtility.downloadRemoteRuntime(DownloadRuntimeOperationUtility.java:194)
at
org.jboss.tools.runtime.ui.internal.wizard.DownloadRuntimeOperationUtility.downloadAndInstall(DownloadRuntimeOperationUtility.java:155)
at
org.jboss.tools.runtime.ui.internal.wizard.FinalizeRuntimeDownloadFragment$9.run(FinalizeRuntimeDownloadFragment.java:588)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54){noformat}
[~maxandersen] suggested to get the filename from the d/l response header instead
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)