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 23051 Details for
Bug 78290
[FTP WebDAV] username not stored / asked for
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.
Modified org/eclipse/target/Site.java
Site.java (text/plain), 6.89 KB, created by
Olivier Oeuillot
on 2005-06-14 09:50:35 EDT
(
hide
)
Description:
Modified org/eclipse/target/Site.java
Filename:
MIME Type:
Creator:
Olivier Oeuillot
Created:
2005-06-14 09:50:35 EDT
Size:
6.89 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2004 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.target; > >import java.net.URL; > >import org.eclipse.core.runtime.*; >import org.eclipse.jface.util.Assert; >import org.eclipse.target.internal.SiteManager; >import org.eclipse.target.internal.registry.SiteDescriptor; >import org.eclipse.ui.IMemento; > >/** > * A <code>Site</code> is a place where resources can be deployed and > * retrieved via a target provider. > * <p> > * <b>Note:</b> This class/interface is part of an interim API that is still under > * development and expected to change significantly before reaching stability. > * It is being made available at this early stage to solicit feedback from pioneering > * adopters on the understanding that any code that uses this API will almost > * certainly be broken (repeatedly) as the API evolves. > * </p> > */ >public abstract class Site extends PlatformObject { > > //The location of the site's resources: > private String location; > private SiteDescriptor descriptor; > > public static Site createSite(String type, String locationId) throws CoreException { > ISiteManager manager = Target.getSiteManager(); > Site site = ((SiteManager)manager).createSite(type); > site.init(locationId, null); > return site; > } > > /** > * No-arg constructor. Subclasses must also provide a non-arg > * constructor so persisted sites can be recreated on startup. > * The {@link #createSite(String, String)} method should be used > * by subclasses when creating sites to ensure that the created > * instance is properly initialized with information from the > * extension manifest file. > */ > public Site() { > } > > /** > * Answers the type identifier for this site. For example: > * <blockquote><pre> > * org.eclipse.webdav > * </pre></blockquote> > * > * @return string identifier for this site > */ > public String getTypeId() { > return descriptor.getId(); > } > > /** > * Answers a string that can be displayed to the user that represents > * this site. For example: > * <blockquote><pre> > * http://usename@www.mysite.com/dav (WebDav) > * </pre></blockquote> > */ > public String getDisplayName() { > return getLocation(); > } > > /** > * Writes the state of this site such that the corresponding call > * to <code>readState</code> can restore the state of this site. > * > * @param memento the memento into which to write it's state > */ > public abstract void save(IMemento memento); > > /** > * Method invoked by the site manager when persisted sites > * are recreated on startup. It invokes the > * {@link #init(IMemento)} method which subclasses > * provide. > * @param locationId the location for this site > * @param memento the memento into which to write it's state > * or <code>null</code> if this is called by a subclass > * to set the location. > */ > public final void init(String locationId, IMemento memento) { > Assert.isTrue(location == null); > Assert.isNotNull(locationId); > location = locationId; > > initializeAuthorization(); > if (memento != null) > init(memento); > } > > /** > * Reads authorizations for this site. > * This method is invoked on startup to restore autorizations. > */ > protected void initializeAuthorization() { > } > > /** > * Reads the state for this site from the given memento. > * This method is invoked on startup to restore the > * state of sites that were persisted. > * @param memento the memento into which to write it's state > */ > protected abstract void init(IMemento memento); > > /** > * Returns a handle to the root resource handle that represents > * this site on the server. > * > * @return a remote handle to this site that may or may not exist > */ > public abstract ITargetResource getRootResource(); > > /** > * Return true if this can be reached (in some fashion). > * This method is not guaranteed to catch all connection failure cases but is used > * to at least test the waters. > * @param monitor a progress monitor > * @return if this can be reached (in some fashion) > */ > public abstract boolean canBeReached(IProgressMonitor monitor) throws CoreException; > > /** > * Compares two Sites. The result is <code>true</code> if and only if > * the argument is not <code>null</code> and is a Site object that > * represents the same Site as this object. Two Site objects are equal > * if they have the same types and URLs. > * > * @param other the Site to compare with > * > * @return <code>true</code> if the Sites are the same; <code>false</code> > * otherwise > * > * @see Object#equals(Object) > */ > public boolean equals(Object other) { > if (this == other) return true; > if (!(other instanceof Site)) return false; > Site location = (Site)other; > if (!getTypeId().equals(location.getTypeId())) return false; > String url = getLocation(); > if (url == null) return super.equals(other); > return url.equals(location.getLocation()); > } > > public int hashCode() { > String url = getLocation(); > if (url == null) return super.hashCode(); > return url.hashCode(); > } > > /** > * Debugging helper > * > * @see Object#toString() > */ > public String toString() { > return getDisplayName(); > } > > /** > * Method invoked when the site is discarded or the Workbench > * is shutdown. Subclasses can override. > * @throws CoreException > */ > public void dispose() throws CoreException { > // Do nothing > } > > /** > * Method that is invoked when the site is discarded. > * Subclasses can override. > * @throws CoreException > */ > public void discarded() throws CoreException { > // Do nothing > } > > /** > * Return the location string that can be used to > * identify and connect to this site. It may be > * a URL or some other connection string. > * @return the location string that can be used to > * identify and connect to this site > */ > public String getLocation() { > return location; > } > > /** > * Method invoked by the Target plugin to initialize this > * instance with the information from the extension > * definition for this site's type. > * @param descriptor a site descriptor > */ > public final void setDescriptor(SiteDescriptor descriptor) { > this.descriptor = descriptor; > } > > /** > * Convert the site's location to a URL. A <code>null</code> > * is returned if the site's location cannot be translated to > * a URL. > * @return the site's location as a URL or <code>null</code> > */ > public abstract URL toUrl(); > > /* (non-Javadoc) > * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) > */ > public Object getAdapter(Class adapter) { > if (adapter.equals(ITargetResource.class)) { > return getRootResource(); > } > return super.getAdapter(adapter); > } > >}
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 78290
:
23049
|
23050
|
23051
|
23053