work in progress
This commit is contained in:
parent
5d648bfc6f
commit
fe9c9ecc5c
2 changed files with 20 additions and 1 deletions
|
@ -2006,7 +2006,15 @@ public class OsmandAidlApi {
|
|||
fos = new FileOutputStream(file, true);
|
||||
fos.write(fileParams.getFilePartData());
|
||||
copyFilesCache.put(
|
||||
key, new FileCopyInfo(fileParams.getStartTime(), System.currentTimeMillis(), fos));
|
||||
key, new FileCopyInfo(fileParams.getStartTime(), System.currentTimeMillis(),
|
||||
fos));
|
||||
return COPY_FILE_OK_RESPONSE;
|
||||
} else if (fileParams.getActionId() == COPY_FILE_FINISH_FLAG) {
|
||||
file.delete();
|
||||
file.getParentFile().mkdirs();
|
||||
fos = new FileOutputStream(file, true);
|
||||
fos.write(fileParams.getFilePartData());
|
||||
file.renameTo(app.getAppPath(destination + fileParams.getFilename()));
|
||||
return COPY_FILE_OK_RESPONSE;
|
||||
} else {
|
||||
return COPY_FILE_PARAMS_ERROR;
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.aidl.tiles;
|
|||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class CopyFileParams implements Parcelable {
|
||||
private String filename;
|
||||
|
@ -58,6 +59,16 @@ public class CopyFileParams implements Parcelable {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CopyFileParams{" +
|
||||
"filename='" + filename + '\'' +
|
||||
", filePartData=" + filePartData +
|
||||
", startTime=" + startTime +
|
||||
", actionId=" + actionId +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(filename);
|
||||
|
|
Loading…
Reference in a new issue