diff options
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java index d549dc1c9..d7782e42a 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java @@ -23,11 +23,11 @@ import org.eclipse.team.core.variants.CachedResourceVariant; * This class provides the implementation for the ICacheEntry */ public class ResourceVariantCacheEntry { - + public static final int UNINITIALIZED = 0; public static final int READY = 1; public static final int DISPOSED = 2; - + private String id; private String filePath; private ResourceVariantCache cache; @@ -64,7 +64,7 @@ public class ResourceVariantCacheEntry { } } catch (IOException e) { // We will end up here if we couldn't read or delete the cache file - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); } // This can occur when there is no remote contents return new ByteArrayInputStream(new byte[0]); @@ -91,7 +91,7 @@ public class ResourceVariantCacheEntry { endOperation(); } } - + private void endOperation() { lock.release(); } @@ -103,13 +103,13 @@ public class ResourceVariantCacheEntry { private void internalSetContents(InputStream stream, IProgressMonitor monitor) throws TeamException { // if the state is DISPOSED then there is a problem if (state == DISPOSED) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCacheEntry_3, new String[] { cache.getName(), id })); + throw new TeamException(NLS.bind(Messages.RemoteContentsCacheEntry_3, new String[] { cache.getName(), id })); } // Otherwise, the state is UNINITIALIZED or READY so we can proceed registerHit(); File ioFile = getFile(); try { - + // Open the cache file for writing OutputStream out; try { @@ -121,9 +121,9 @@ public class ResourceVariantCacheEntry { out = new ByteArrayOutputStream(); } } catch (FileNotFoundException e) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); } - + // Transfer the contents try { try { @@ -141,11 +141,11 @@ public class ResourceVariantCacheEntry { cache.purgeFromCache(this); throw e; } - + // Mark the cache entry as ready state = READY; } catch (IOException e) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); } finally { try { stream.close(); @@ -162,7 +162,7 @@ public class ResourceVariantCacheEntry { public int getState() { return state; } - + /* (non-Javadoc) * @see org.eclipse.team.core.sync.ICacheEntry#getSize() */ @@ -202,15 +202,15 @@ public class ResourceVariantCacheEntry { } } - + public String getId() { return id; } - + public CachedResourceVariant getResourceVariant() { return resourceVariant; } - + public void setResourceVariant(CachedResourceVariant resourceVariant) { this.resourceVariant = resourceVariant; } |