File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 */
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 >();
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments