Lines 12-35
Link Here
|
12 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
13 |
package org.eclipse.equinox.internal.p2.updatesite.metadata; |
13 |
package org.eclipse.equinox.internal.p2.updatesite.metadata; |
14 |
|
14 |
|
15 |
import org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory; |
|
|
16 |
|
17 |
import org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory; |
18 |
|
19 |
import org.eclipse.equinox.p2.core.ProvisionException; |
20 |
|
21 |
import java.io.File; |
15 |
import java.io.File; |
22 |
import java.io.FileNotFoundException; |
|
|
23 |
import java.net.URI; |
16 |
import java.net.URI; |
24 |
import java.util.Map; |
17 |
import java.util.Map; |
25 |
import org.eclipse.core.runtime.*; |
18 |
import org.eclipse.core.runtime.*; |
26 |
import org.eclipse.ecf.filetransfer.UserCancelledException; |
|
|
27 |
import org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository; |
19 |
import org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository; |
28 |
import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException; |
20 |
import org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory; |
29 |
import org.eclipse.equinox.internal.p2.updatesite.*; |
21 |
import org.eclipse.equinox.internal.p2.updatesite.*; |
|
|
22 |
import org.eclipse.equinox.p2.core.ProvisionException; |
30 |
import org.eclipse.equinox.p2.publisher.*; |
23 |
import org.eclipse.equinox.p2.publisher.*; |
31 |
import org.eclipse.equinox.p2.repository.IRepositoryManager; |
24 |
import org.eclipse.equinox.p2.repository.IRepositoryManager; |
32 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; |
25 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; |
|
|
26 |
import org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory; |
33 |
import org.eclipse.osgi.util.NLS; |
27 |
import org.eclipse.osgi.util.NLS; |
34 |
|
28 |
|
35 |
public class UpdateSiteMetadataRepositoryFactory extends MetadataRepositoryFactory { |
29 |
public class UpdateSiteMetadataRepositoryFactory extends MetadataRepositoryFactory { |
Lines 49-71
Link Here
|
49 |
return null; |
43 |
return null; |
50 |
} |
44 |
} |
51 |
|
45 |
|
52 |
public IStatus validate(URI location, IProgressMonitor monitor) { |
|
|
53 |
try { |
54 |
UpdateSite.validate(location, monitor); |
55 |
} catch (ProvisionException e) { |
56 |
return e.getStatus(); |
57 |
} catch (UserCancelledException e) { |
58 |
return Status.CANCEL_STATUS; |
59 |
} catch (AuthenticationFailedException e) { |
60 |
return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.AuthenticationFailedFor_0, location.toString()), e); |
61 |
} catch (FileNotFoundException e) { |
62 |
return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.RepositoryNotFound_0, location.toString()), e); |
63 |
} catch (CoreException e) { |
64 |
return e.getStatus(); |
65 |
} |
66 |
return Status.OK_STATUS; |
67 |
} |
68 |
|
69 |
public IMetadataRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException { |
46 |
public IMetadataRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException { |
70 |
//return null if the caller wanted a modifiable repo |
47 |
//return null if the caller wanted a modifiable repo |
71 |
if ((flags & IRepositoryManager.REPOSITORY_HINT_MODIFIABLE) > 0) { |
48 |
if ((flags & IRepositoryManager.REPOSITORY_HINT_MODIFIABLE) > 0) { |