1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.exoplatform.singleton;
20
21 import org.exoplatform.model.ExoFile;
22
23 import android.os.Bundle;
24 import android.os.Parcel;
25 import android.os.Parcelable;
26
27
28
29
30
31 public class DocumentHelper implements Parcelable {
32
33 private static DocumentHelper documentHelper = new DocumentHelper();
34
35 private String _urlrepositoryHome;
36
37 public ExoFile _fileCopied = new ExoFile();
38
39 public ExoFile _fileMoved = new ExoFile();
40
41 public String repository = null;
42
43 public String workspace = null;
44
45
46
47
48
49 public Bundle folderToChildrenMap;
50
51
52
53
54
55
56 public Bundle folderToParentMap;
57
58 private DocumentHelper() {
59
60 }
61
62 public static DocumentHelper getInstance() {
63 return documentHelper;
64 }
65
66 public void setInstance(DocumentHelper helper) {
67 documentHelper = helper;
68 }
69
70 public void setRepositoryHomeUrl(String url) {
71 _urlrepositoryHome = url;
72 }
73
74 public String getRepositoryHomeUrl() {
75 return _urlrepositoryHome;
76 }
77
78 private DocumentHelper(Parcel in) {
79 readFromParcel(in);
80 }
81
82 public static final Parcelable.Creator<DocumentHelper> CREATOR = new Parcelable.Creator<DocumentHelper>() {
83 public DocumentHelper createFromParcel(Parcel in) {
84 return new DocumentHelper(in);
85 }
86
87 public DocumentHelper[] newArray(int size) {
88 return new DocumentHelper[size];
89 }
90 };
91
92 private void readFromParcel(Parcel in) {
93 _urlrepositoryHome = in.readString();
94 _fileCopied = in.readParcelable(_fileCopied.getClass().getClassLoader());
95 _fileMoved = in.readParcelable(_fileMoved.getClass().getClassLoader());
96 repository = in.readString();
97 folderToParentMap = in.readBundle();
98 folderToChildrenMap = in.readBundle();
99 }
100
101
102
103
104
105 @Override
106 public int describeContents() {
107 return 0;
108 }
109
110
111
112
113
114 @Override
115 public void writeToParcel(Parcel dest, int flags) {
116 dest.writeString(_urlrepositoryHome);
117 dest.writeParcelable(_fileCopied, flags);
118 dest.writeParcelable(_fileMoved, flags);
119 dest.writeString(repository);
120 dest.writeBundle(folderToParentMap);
121 dest.writeBundle(folderToChildrenMap);
122 }
123
124 }