Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 206260 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/monitoring/logui/internal/wizards/ImportLogWizard.java (-1 / +1 lines)
Lines 1996-2002 Link Here
1996
		}
1996
		}
1997
		LocalLogImportJob job = new LocalLogImportJob(LogUIMessages._7, handler, element);
1997
		LocalLogImportJob job = new LocalLogImportJob(LogUIMessages._7, handler, element);
1998
		final String filePath = (String) element.getValues().get("file_path");
1998
		final String filePath = (String) element.getValues().get("file_path");
1999
		if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://"))) {
1999
		if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://")  || filePath.startsWith("https://"))) {
2000
			Authenticator authenticator = new Authenticator(){
2000
			Authenticator authenticator = new Authenticator(){
2001
				ImportPasswordAuthentication importLogAuthentication = null;
2001
				ImportPasswordAuthentication importLogAuthentication = null;
2002
				
2002
				
(-)cbe.import/org/eclipse/tptp/monitoring/log/internal/core/CBEServiceFactoryImpl.java (-1 / +1 lines)
Lines 23-29 Link Here
23
		IImportHandler handler = null;
23
		IImportHandler handler = null;
24
		if (element.isLocalhost()){
24
		if (element.isLocalhost()){
25
			final String filePath = (String) element.getValues().get("file_path");
25
			final String filePath = (String) element.getValues().get("file_path");
26
			if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://"))) {
26
			if (filePath != null && (filePath.startsWith("ftp://") || filePath.startsWith("http://") || filePath.startsWith("https://"))) {
27
				handler =  new LocalDownloadImportHandler(element ,context);				
27
				handler =  new LocalDownloadImportHandler(element ,context);				
28
			}
28
			}
29
			else{
29
			else{
(-)cbe.import/org/eclipse/tptp/monitoring/log/internal/core/LocalDownloadImportHandler.java (-1 / +22 lines)
Lines 19-24 Link Here
19
import java.io.InputStream;
19
import java.io.InputStream;
20
import java.io.OutputStream;
20
import java.io.OutputStream;
21
import java.net.Authenticator;
21
import java.net.Authenticator;
22
import java.net.HttpURLConnection;
22
import java.net.URL;
23
import java.net.URL;
23
import java.net.URLConnection;
24
import java.net.URLConnection;
24
import java.util.Date;
25
import java.util.Date;
Lines 61-68 Link Here
61
		File file;			
62
		File file;			
62
		String key = GLAHelper.getAdapterPathKey(parserInput);
63
		String key = GLAHelper.getAdapterPathKey(parserInput);
63
		try {
64
		try {
64
			
65
65
			URLConnection connection = (new URL(fileURL)).openConnection();
66
			URLConnection connection = (new URL(fileURL)).openConnection();
67
			//fix for bugzilla 206260
68
			if(connection instanceof HttpURLConnection)
69
			{
70
				// Redirect a maximum of five times. This is a generally accepted check which makes sure that
71
				// multiple redirects are supported, but this is not infinite.
72
				for(int i =0; i < 5;i++)
73
				{
74
					int retCode = ((HttpURLConnection)connection).getResponseCode();
75
					if(retCode == HttpURLConnection.HTTP_MOVED_PERM || retCode == HttpURLConnection.HTTP_MOVED_TEMP)
76
					{
77
						String location = connection.getHeaderField("location");
78
						connection = (new URL(location)).openConnection();
79
					}
80
					else
81
					{
82
						break;
83
					}
84
				}				
85
			}
86
			//end of fix for bugzilla 206260
66
			InputStream inputStream = connection.getInputStream();
87
			InputStream inputStream = connection.getInputStream();
67
			SimpleDateFormat format = new SimpleDateFormat("yyyymmddhhMMss");   //$NON-NLS-1$
88
			SimpleDateFormat format = new SimpleDateFormat("yyyymmddhhMMss");   //$NON-NLS-1$
68
	
89
	

Return to bug 206260