|
Lines 19-34
Link Here
|
| 19 |
import java.util.zip.ZipException; |
19 |
import java.util.zip.ZipException; |
| 20 |
import java.util.zip.ZipFile; |
20 |
import java.util.zip.ZipFile; |
| 21 |
|
21 |
|
|
|
22 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 23 |
import org.eclipse.jface.viewers.IStructuredSelection; |
| 24 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
| 22 |
import org.eclipse.swt.SWT; |
25 |
import org.eclipse.swt.SWT; |
| 23 |
import org.eclipse.swt.widgets.Button; |
26 |
import org.eclipse.swt.widgets.Button; |
| 24 |
import org.eclipse.swt.widgets.Composite; |
27 |
import org.eclipse.swt.widgets.Composite; |
| 25 |
import org.eclipse.swt.widgets.FileDialog; |
28 |
import org.eclipse.swt.widgets.FileDialog; |
| 26 |
import org.eclipse.swt.widgets.Listener; |
29 |
import org.eclipse.swt.widgets.Listener; |
| 27 |
|
|
|
| 28 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 29 |
import org.eclipse.jface.viewers.IStructuredSelection; |
| 30 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
| 31 |
|
| 32 |
import org.eclipse.ui.IWorkbench; |
30 |
import org.eclipse.ui.IWorkbench; |
| 33 |
import org.eclipse.ui.PlatformUI; |
31 |
import org.eclipse.ui.PlatformUI; |
| 34 |
import org.eclipse.ui.model.AdaptableList; |
32 |
import org.eclipse.ui.model.AdaptableList; |
|
Lines 149-154
Link Here
|
| 149 |
private boolean ensureZipSourceIsValid() { |
147 |
private boolean ensureZipSourceIsValid() { |
| 150 |
ZipFile specifiedFile = getSpecifiedZipSourceFile(); |
148 |
ZipFile specifiedFile = getSpecifiedZipSourceFile(); |
| 151 |
if (specifiedFile == null) { |
149 |
if (specifiedFile == null) { |
|
|
150 |
setErrorMessage(DataTransferMessages.ZipImport_badFormat); |
| 152 |
return false; |
151 |
return false; |
| 153 |
} |
152 |
} |
| 154 |
return ArchiveFileManipulations.closeZipFile(specifiedFile, getShell()); |
153 |
return ArchiveFileManipulations.closeZipFile(specifiedFile, getShell()); |
|
Lines 157-162
Link Here
|
| 157 |
private boolean ensureTarSourceIsValid() { |
156 |
private boolean ensureTarSourceIsValid() { |
| 158 |
TarFile specifiedFile = getSpecifiedTarSourceFile(); |
157 |
TarFile specifiedFile = getSpecifiedTarSourceFile(); |
| 159 |
if( specifiedFile == null ) { |
158 |
if( specifiedFile == null ) { |
|
|
159 |
setErrorMessage(DataTransferMessages.TarImport_badFormat); |
| 160 |
return false; |
160 |
return false; |
| 161 |
} |
161 |
} |
| 162 |
return ArchiveFileManipulations.closeTarFile(specifiedFile, getShell()); |
162 |
return ArchiveFileManipulations.closeTarFile(specifiedFile, getShell()); |
|
Lines 300-308
Link Here
|
| 300 |
try { |
300 |
try { |
| 301 |
return new ZipFile(fileName); |
301 |
return new ZipFile(fileName); |
| 302 |
} catch (ZipException e) { |
302 |
} catch (ZipException e) { |
| 303 |
displayErrorDialog(DataTransferMessages.ZipImport_badFormat); |
303 |
// ignore |
| 304 |
} catch (IOException e) { |
304 |
} catch (IOException e) { |
| 305 |
displayErrorDialog(DataTransferMessages.ZipImport_couldNotRead); |
305 |
// ignore |
| 306 |
} |
306 |
} |
| 307 |
|
307 |
|
| 308 |
sourceNameField.setFocus(); |
308 |
sourceNameField.setFocus(); |
|
Lines 329-337
Link Here
|
| 329 |
try { |
329 |
try { |
| 330 |
return new TarFile(fileName); |
330 |
return new TarFile(fileName); |
| 331 |
} catch (TarException e) { |
331 |
} catch (TarException e) { |
| 332 |
displayErrorDialog(DataTransferMessages.TarImport_badFormat); |
332 |
// ignore |
| 333 |
} catch (IOException e) { |
333 |
} catch (IOException e) { |
| 334 |
displayErrorDialog(DataTransferMessages.ZipImport_couldNotRead); |
334 |
// ignore |
| 335 |
} |
335 |
} |
| 336 |
|
336 |
|
| 337 |
sourceNameField.setFocus(); |
337 |
sourceNameField.setFocus(); |
|
Lines 489-495
Link Here
|
| 489 |
enableButtonGroup(false); |
489 |
enableButtonGroup(false); |
| 490 |
return false; |
490 |
return false; |
| 491 |
} |
491 |
} |
| 492 |
|
492 |
|
| 493 |
List resourcesToExport = selectionGroup.getAllWhiteCheckedItems(); |
493 |
List resourcesToExport = selectionGroup.getAllWhiteCheckedItems(); |
| 494 |
if (resourcesToExport.size() == 0){ |
494 |
if (resourcesToExport.size() == 0){ |
| 495 |
setErrorMessage(DataTransferMessages.FileImport_noneSelected); |
495 |
setErrorMessage(DataTransferMessages.FileImport_noneSelected); |