View | Details | Raw Unified | Return to bug 344954
Collapse All | Expand All

(-)src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java (-15 / +17 lines)
Lines 752-773 Link Here
752
752
753
	public InputStream read(IFile target, boolean force, IProgressMonitor monitor) throws CoreException {
753
	public InputStream read(IFile target, boolean force, IProgressMonitor monitor) throws CoreException {
754
		IFileStore store = getStore(target);
754
		IFileStore store = getStore(target);
755
		final IFileInfo fileInfo = store.fetchInfo();
755
		if (lightweightAutoRefreshEnabled || !force) {
756
		if (!fileInfo.exists()) {
756
			final IFileInfo fileInfo = store.fetchInfo();
757
			asyncRefresh(target);
757
			if (!fileInfo.exists()) {
758
			if (!force) {
758
				asyncRefresh(target);
759
				String message = NLS.bind(Messages.localstore_fileNotFound, store.toString());
759
				if (!force) {
760
				throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, target.getFullPath(), message, null);
760
					String message = NLS.bind(Messages.localstore_fileNotFound, store.toString());
761
					throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, target.getFullPath(), message, null);
762
				}
761
			}
763
			}
762
		}
764
			ResourceInfo info = ((Resource) target).getResourceInfo(true, false);
763
		ResourceInfo info = ((Resource) target).getResourceInfo(true, false);
765
			int flags = ((Resource) target).getFlags(info);
764
		int flags = ((Resource) target).getFlags(info);
766
			((Resource) target).checkExists(flags, true);
765
		((Resource) target).checkExists(flags, true);
767
			if (fileInfo.getLastModified() != info.getLocalSyncInfo()) {
766
		if (fileInfo.getLastModified() != info.getLocalSyncInfo()) {
768
				asyncRefresh(target);
767
			asyncRefresh(target);
769
				if (!force) {
768
			if (!force) {
770
					String message = NLS.bind(Messages.localstore_resourceIsOutOfSync, target.getFullPath());
769
				String message = NLS.bind(Messages.localstore_resourceIsOutOfSync, target.getFullPath());
771
					throw new ResourceException(IResourceStatus.OUT_OF_SYNC_LOCAL, target.getFullPath(), message, null);
770
				throw new ResourceException(IResourceStatus.OUT_OF_SYNC_LOCAL, target.getFullPath(), message, null);
772
				}
771
			}
773
			}
772
		}
774
		}
773
		return store.openInputStream(EFS.NONE, monitor);
775
		return store.openInputStream(EFS.NONE, monitor);

Return to bug 344954