mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 19:05:38 +02:00
[400251] [dstore] backup files cause problem when parent folder is
read-only
This commit is contained in:
parent
4886d33460
commit
9ffa152e3c
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2012 IBM Corporation and others.
|
* Copyright (c) 2002, 2013 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
* David McKnight (IBM) [367424] [dstore] upload mechanism should provide backups of files
|
* David McKnight (IBM) [367424] [dstore] upload mechanism should provide backups of files
|
||||||
* David McKnight (IBM) [380023] [dstore] remote file permissions lost after upload
|
* David McKnight (IBM) [380023] [dstore] remote file permissions lost after upload
|
||||||
* David McKnight (IBM) [385630] [dstore] backup files created during upload should be removed when upload successful
|
* David McKnight (IBM) [385630] [dstore] backup files created during upload should be removed when upload successful
|
||||||
|
* David McKnight (IBM) [400251] [dstore] backup files cause problem when parent folder is read-only
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.dstore.core.model;
|
package org.eclipse.dstore.core.model;
|
||||||
|
@ -204,7 +205,7 @@ public class ByteStreamHandler implements IByteStreamHandler
|
||||||
{
|
{
|
||||||
if (!_dataStore.isVirtual()){ // only applies to server
|
if (!_dataStore.isVirtual()){ // only applies to server
|
||||||
// backup file on upload by default
|
// backup file on upload by default
|
||||||
if (_doBackups){
|
if (_doBackups && parent.canWrite()){
|
||||||
// backup the file first
|
// backup the file first
|
||||||
String n = file.getName();
|
String n = file.getName();
|
||||||
backupFile = new File(parent, '.' + n + '~');
|
backupFile = new File(parent, '.' + n + '~');
|
||||||
|
|
Loading…
Add table
Reference in a new issue