MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / writeToFile

Method writeToFile

samples/JGroups/src/S3_PING.java:134–149  ·  view source on GitHub ↗
(PingData data, String clustername)

Source from the content-addressed store, hash-verified

132
133
134 protected void writeToFile(PingData data, String clustername) {
135 if(clustername == null || data == null)
136 return;
137 String filename=local_addr instanceof org.jgroups.util.UUID? ((org.jgroups.util.UUID)local_addr).toStringLong() : local_addr.toString();
138 String key=clustername + "/" + filename;
139 try {
140 Map headers=new TreeMap();
141 headers.put("Content-Type", Arrays.asList("text/plain"));
142 byte[] buf=Util.objectToByteBuffer(data);
143 S3Object val=new S3Object(buf, null);
144 conn.put(location, key, val, headers).connection.getResponseMessage();
145 }
146 catch(Exception e) {
147 log.error("failed marshalling " + data + " to buffer", e);
148 }
149 }
150
151
152 protected void remove(String clustername, Address addr) {

Callers

nothing calls this directly

Calls 3

putMethod · 0.65
toStringMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected