Author: vyemialyanchyk
Date: 2010-02-08 13:15:41 -0500 (Mon, 08 Feb 2010)
New Revision: 20185
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5706 - make files transfer operation more stable
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java 2010-02-08
18:08:29 UTC (rev 20184)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java 2010-02-08
18:15:41 UTC (rev 20185)
@@ -87,18 +87,34 @@
BufferedInputStream bis = null;
try {
if (iFile.exists()) {
- iFile.delete(true, null);
+ try {
+ iFile.delete(true, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
}
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
- iFile.create(bis, IResource.FORCE, null);
+ int nTryCounter = 5;
+ while (nTryCounter > 0) {
+ try {
+ iFile.create(bis, IResource.FORCE, null);
+ nTryCounter = 0;
+ } catch (CoreException e) {
+ e.printStackTrace();
+ nTryCounter--;
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e1) {
+ // ignore
+ }
+ }
+ }
if (filesList != null) {
filesList.add(iFile.getFullPath());
}
} catch (FileNotFoundException e) {
e.printStackTrace();
- } catch (CoreException e) {
- e.printStackTrace();
} finally {
if (bis != null) {
try {