Java Code Examples for org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider#getRoot()

The following examples show how to use org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider#getRoot() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BirtWizardUtil.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * extract zip file and import files into project
 * 
 * @param srcZipFile
 * @param destPath
 * @param monitor
 * @param query
 * @throws CoreException
 */
private static void importFilesFromZip( ZipFile srcZipFile, IPath destPath,
		IProgressMonitor monitor, IOverwriteQuery query )
		throws CoreException
{
	try
	{
		ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(
				srcZipFile );
		List list = prepareFileList( structureProvider, structureProvider
				.getRoot( ), null );
		ImportOperation op = new ImportOperation( destPath,
				structureProvider.getRoot( ), structureProvider, query,
				list );
		op.run( monitor );
	}
	catch ( Exception e )
	{
		String message = srcZipFile.getName( ) + ": " + e.getMessage( ); //$NON-NLS-1$
		Logger.logException( e );
		throw BirtCoreException.getException( message, e );
	}
}
 
Example 2
Source File: JavaProjectHelper.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor)
        throws InvocationTargetException {
    ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
    try {
        ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider,
                new ImportOverwriteQuery());
        op.run(monitor);
    } catch (InterruptedException e) {
        // should not happen
    }
}