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 82640 Details for
Bug 206260
HTTP Import: log on dialog not show up for some urls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated patch
206260.txt (text/plain), 7.52 KB, created by
Rohit Shetty
on 2007-11-12 02:05:32 EST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Rohit Shetty
Created:
2007-11-12 02:05:32 EST
Size:
7.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.monitoring.logui >Index: src/org/eclipse/tptp/monitoring/logui/internal/wizards/LogLocationUI.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.logui/src/org/eclipse/tptp/monitoring/logui/internal/wizards/LogLocationUI.java,v >retrieving revision 1.30 >diff -u -r1.30 LogLocationUI.java >--- src/org/eclipse/tptp/monitoring/logui/internal/wizards/LogLocationUI.java 30 May 2007 16:18:57 -0000 1.30 >+++ src/org/eclipse/tptp/monitoring/logui/internal/wizards/LogLocationUI.java 12 Nov 2007 07:04:04 -0000 >@@ -453,7 +453,7 @@ > if(value!=null){ > ((IImportWizardWidget)widget).setValue(value); > if(id.equals("file_path")){ >- boolean hostEnabled = !(value.startsWith("ftp://") || value.startsWith("http://")); >+ boolean hostEnabled = !(value.startsWith("ftp://") || value.startsWith("http://") || value.startsWith("https://")); > details.setHostEnabled(hostEnabled); > } > >@@ -614,7 +614,7 @@ > String key = (String) iterator.next(); > if(key.equals("file_path")){ > String value = (String)values.get(key); >- if(value != null && (value.startsWith("ftp://") || value.startsWith("http://"))){ >+ if(value != null && (value.startsWith("ftp://") || value.startsWith("http://") || value.startsWith("https://"))){ > String host = extractHostFromURL(value); > if(host != null){ > logElem.setVirtualHost(host); >@@ -645,7 +645,7 @@ > ImportWizardTextField filePathTextField = (ImportWizardTextField)activeComposite.getControlLookup().get("file_path"); > if(filePathTextField != null && filePathTextField.getText().equals(e.widget)){ > // a modification happened in the text field, verify if the file path is an ftp or http URL. If so, disable host selection and extract the host from the URL >- boolean hostEnabledState = !(((Text)e.widget).getText().startsWith("ftp://") || ((Text)e.widget).getText().startsWith("http://")); >+ boolean hostEnabledState = !(((Text)e.widget).getText().startsWith("ftp://") || ((Text)e.widget).getText().startsWith("http://") || ((Text)e.widget).getText().startsWith("https://")); > details.setHostEnabled(hostEnabledState); > > } >Index: src/org/eclipse/tptp/monitoring/logui/internal/wizards/ImportLogWizard.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.logui/src/org/eclipse/tptp/monitoring/logui/internal/wizards/ImportLogWizard.java,v >retrieving revision 1.105 >diff -u -r1.105 ImportLogWizard.java >--- src/org/eclipse/tptp/monitoring/logui/internal/wizards/ImportLogWizard.java 26 Aug 2007 19:44:59 -0000 1.105 >+++ src/org/eclipse/tptp/monitoring/logui/internal/wizards/ImportLogWizard.java 12 Nov 2007 07:04:03 -0000 >@@ -1996,7 +1996,7 @@ > } > LocalLogImportJob job = new LocalLogImportJob(LogUIMessages._7, handler, element); > final String filePath = (String) element.getValues().get("file_path"); >- if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://"))) { >+ if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://") || filePath.startsWith("https://"))) { > Authenticator authenticator = new Authenticator(){ > ImportPasswordAuthentication importLogAuthentication = null; > >#P org.eclipse.tptp.monitoring.la.core >Index: cbe.import/org/eclipse/tptp/monitoring/log/internal/core/CBEServiceFactoryImpl.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.la.core/cbe.import/org/eclipse/tptp/monitoring/log/internal/core/CBEServiceFactoryImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 CBEServiceFactoryImpl.java >--- cbe.import/org/eclipse/tptp/monitoring/log/internal/core/CBEServiceFactoryImpl.java 18 Sep 2006 19:37:05 -0000 1.2 >+++ cbe.import/org/eclipse/tptp/monitoring/log/internal/core/CBEServiceFactoryImpl.java 12 Nov 2007 07:04:07 -0000 >@@ -23,7 +23,7 @@ > IImportHandler handler = null; > if (element.isLocalhost()){ > final String filePath = (String) element.getValues().get("file_path"); >- if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://"))) { >+ if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://") || filePath.startsWith("https://"))) { > handler = new LocalDownloadImportHandler(element ,context); > } > else{ >Index: cbe.import/org/eclipse/tptp/monitoring/log/internal/core/LocalDownloadImportHandler.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.la.core/cbe.import/org/eclipse/tptp/monitoring/log/internal/core/LocalDownloadImportHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 LocalDownloadImportHandler.java >--- cbe.import/org/eclipse/tptp/monitoring/log/internal/core/LocalDownloadImportHandler.java 1 Mar 2007 17:13:15 -0000 1.4 >+++ cbe.import/org/eclipse/tptp/monitoring/log/internal/core/LocalDownloadImportHandler.java 12 Nov 2007 07:04:07 -0000 >@@ -19,6 +19,7 @@ > import java.io.InputStream; > import java.io.OutputStream; > import java.net.Authenticator; >+import java.net.HttpURLConnection; > import java.net.URL; > import java.net.URLConnection; > import java.util.Date; >@@ -53,7 +54,7 @@ > String destPath = (String)context.getProperty(IImportHandler.TEMP_DIRECTORY); > final String fileURL = (String)element.getValues().get("file_path"); //$NON-NLS-1$ > >- //**Need to authenticate **// >+ //**Need to authenticate **/// > monitor.beginTask(element.getAgentName(), IProgressMonitor.UNKNOWN); > monitor.subTask(" "+StringUtil.replace(Messages.getString("LocalDownloadImportHandler.2", locale),"{0}", fileURL)); //$NON-NLS-1$ //$NON-NLS-2$ > Authenticator.setDefault (authenticator); >@@ -61,8 +62,28 @@ > File file; > String key = GLAHelper.getAdapterPathKey(parserInput); > try { >- >+ > URLConnection connection = (new URL(fileURL)).openConnection(); >+ //fix for bugzilla 206260 >+ if(connection instanceof HttpURLConnection) >+ { >+ // Redirect a maximum of five times. This is a generally accepted check which makes sure that >+ // multiple redirects are supported, but this is not infinite. >+ for(int i =0; i < 5;i++) >+ { >+ int retCode = ((HttpURLConnection)connection).getResponseCode(); >+ if( retCode >= 300 && retCode < 400) >+ { >+ String location = connection.getHeaderField("location"); >+ connection = (new URL(location)).openConnection(); >+ } >+ else >+ { >+ break; >+ } >+ } >+ } >+ //end of fix for bugzilla 206260 > InputStream inputStream = connection.getInputStream(); > SimpleDateFormat format = new SimpleDateFormat("yyyymmddhhMMss"); //$NON-NLS-1$ > >@@ -110,7 +131,15 @@ > int j = fileURL.lastIndexOf('.'); > String namePrefix = i > 0 && j > 0 ? fileURL.substring(i + 1, j) : "tmp"+format.format(new Date()); //$NON-NLS-1$ > String nameSuffix = i > 0 && j > 0 ? fileURL.substring(j + 1) : "log"; //$NON-NLS-1$ >- file = File.createTempFile(namePrefix, nameSuffix, parent); >+ try >+ { >+ file = File.createTempFile(namePrefix, nameSuffix, parent); >+ } >+ catch(Exception e) >+ { >+ file = File.createTempFile("tmp" + format.format(new Date()), "log", parent); >+ } >+ > file.deleteOnExit(); > copyInputStream(inputStream, new BufferedOutputStream(new FileOutputStream(file))); >
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 Diff
View Attachment As Raw
Flags:
rohit.shetty
:
review?
Actions:
View
|
Diff
Attachments on
bug 206260
:
82417
|
82555
|
82560
|
82621
| 82640 |
83937
|
83938