Skip to content

Commit 3d89bd2

Browse files
committed
sync development with makan sub project
1 parent 7d40aa8 commit 3d89bd2

6 files changed

Lines changed: 21 additions & 7 deletions

File tree

src/net/sharksystem/asap/ASAPChunk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public interface ASAPChunk {
8888

8989
/**
9090
* adds a message
91-
* @param message
91+
* @param messageAsBytes
9292
* @throws IOException
9393
* @deprecated
9494
*/

src/net/sharksystem/asap/ASAPChunkFS.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ public void addRecipient(CharSequence recipient) throws IOException {
125125
@Override
126126
public void setRecipients(Collection<CharSequence> newRecipients) throws IOException {
127127
this.recipients = new HashSet<>();
128-
for(CharSequence recipient : newRecipients) {
129-
this.recipients.add(recipient);
128+
if(recipients != null) {
129+
for (CharSequence recipient : newRecipients) {
130+
this.recipients.add(recipient);
131+
}
130132
}
131133

132134
this.writeMetaData(this.metaFile);

src/net/sharksystem/asap/ASAPEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ public Set<CharSequence> getRecipients(CharSequence urlTarget) throws IOExceptio
155155
return this.chunkStorage.getChunk(urlTarget, this.era).getRecipients();
156156
}
157157

158-
public void removeRecipient(CharSequence urlTarget, CharSequence recipients) throws IOException {
159-
this.chunkStorage.getChunk(urlTarget, this.era).removeRecipient(recipients);
158+
public void removeRecipient(CharSequence urlTarget, CharSequence recipient) throws IOException {
159+
this.chunkStorage.getChunk(urlTarget, this.era).removeRecipient(recipient);
160160
}
161161

162162
@Override

src/net/sharksystem/asap/ASAPStorage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public interface ASAPStorage {
137137
*/
138138
public Set<CharSequence> getRecipients(CharSequence urlTarget) throws IOException;
139139

140+
void addRecipient(CharSequence urlTarget, CharSequence recipient) throws IOException;
141+
public void removeRecipient(CharSequence urlTarget, CharSequence recipient) throws IOException;
140142
/**
141143
* Put some extra information on that channel
142144
* @param uri describing the channel

src/net/sharksystem/asap/util/Helper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public static String collection2String(Collection<CharSequence> stringList) {
2525
return sb.toString();
2626
}
2727

28+
public static byte[] characterSequence2bytes(CharSequence cs) {
29+
// TODO - that's ok?
30+
return cs.toString().getBytes();
31+
}
32+
33+
public static CharSequence bytes2characterSequence(byte[] bytes) {
34+
// TODO - that's ok?
35+
return new String(bytes);
36+
}
37+
2838
public static List<CharSequence> string2CharSequenceList(String s) {
2939
StringTokenizer t = new StringTokenizer(s, SERIALIZATION_DELIMITER);
3040
ArrayList<CharSequence> list = new ArrayList<CharSequence>();

src/net/sharksystem/asap/util/Log.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ public static StringBuilder startLog(Object o) {
55
return Log.startLog(o.getClass());
66
}
77

8-
public static StringBuilder startLog(Class c) {
9-
StringBuilder sb = new StringBuilder();
8+
public static StringBuilder startLog(Class c) {
9+
StringBuilder sb = new StringBuilder();
1010
sb.append(c.getSimpleName());
1111
sb.append(": ");
1212
return sb;

0 commit comments

Comments
 (0)