blob: d1d51b527c050fa861a7649af182c868906a5920 [file] [log] [blame]
package org.eclipse.epp.installer.core;
import java.io.File;
import java.util.Map;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.epp.installer.internal.core.operations.ProxyOperation;
import org.eclipse.epp.installer.internal.core.operations.StubOperation;
/**
* Platform-dependent service providers must implement this interface.
*/
public interface IPlatform extends IExecutableExtension {
public static final int DRIVE_UNKNOWN = 0;
public static final int DRIVE_NO_ROOT_DIR = 1;
public static final int DRIVE_REMOVABLE = 2;
public static final int DRIVE_FIXED = 3;
public static final int DRIVE_REMOTE = 4;
public static final int DRIVE_CDROM = 5;
public static final int DRIVE_RAMDISK = 6;
/**
* Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk,
* or network drive.
*
* Temporarily until os.so will be built
* TODO change this calls with direct OS.GetDriveType(driveRootPath) calls
*
* @param driveRootPath
* String that identifies root drive path
* @return int return type of a specified drive
*/
public int GetDriveType( String driveRootPath );
/**
* Check if file can be read.
*
* @param file
* @return
*/
public boolean canRead(File file);
/**
* Check if file can be written.
*
* @param file
* @return
*/
public boolean canWrite(File file);
/**
* Answer possible product installation locations extracted from the registry
* such as IBM Rational Application Developer.
*
* @return an array of paths to installation locations
*/
String[] readEclipseLocationsFromRegistry();
/**
* Answer possible product installation locations extracted from the registry
*
* @return an array of paths to installation locations
*/
String[] readPreviousProductInstallLocations(InstallOptions options);
/**
* Answer other possible platform specific installation locations such as SAP
* Netweaver which does not have a registry entry or platform specific locations such
* as Linux user.home and user desktop.
*
* @return an array of paths to installation locations or <code>null</code> if none
*/
String[] otherEclipseLocations();
/**
* Method used to resolve proxied operations.
* Such operations have platform dependent implementations.
*/
StubOperation resolveProxyOperation(ProxyOperation operation);
/**
* Method used to set creation time of file
* @param path to file
* @param time to set
* @return true if time was setted and false othewise
*/
boolean setFileCreationTime(String path,long time);
/**
* Method used to read product uninstall properties from from the registry
* @param installOptions that contains product name and version
* @return Map of product properties
*/
IStatus readProductUninstallPropertiesFromRegistry(InstallOptions installOptions, Map productProperties);
}