public void write(Path path, ByteArrayOutputStream os) throws IOException { boolean first = true; for (Part p : path.parts) { if (!first) { path_seperator.writeTo(os); } new AsciiBuffer(p.toString(this)).writeTo(os); first = false; } }
/** * Converts the path back to the string representation. * * @return */ public String toString(Path path) { StringBuffer buffer = new StringBuffer(); boolean first = true; for (Part p : path.parts) { if (!first) { buffer.append(path_seperator); } buffer.append(p.toString(this)); first = false; } return buffer.toString(); }
@RequestMapping(method = RequestMethod.PUT) public void addPart( @RequestParam("partid") Long pId, @RequestParam("partdesc") String pDesc, @RequestParam("productiondate") Date pDate) { LOG.log(Level.INFO, "PUT request"); Part p = new Part(); p.partid = pId; p.partdesc = pDesc; p.productiondate = pDate; mParts.add(p); mMap.put(mParts.indexOf(p), p.partid); LOG.fine(new Date() + " POST Insert\t" + p.toString()); }
@RequestMapping(method = RequestMethod.POST) public void updatePart( @RequestParam("partid") Long pId, @RequestParam("partdesc") String pDesc, @RequestParam("productiondate") Date pDate, @RequestParam("param1") int recId) { LOG.log(Level.INFO, "POST request"); Part p = new Part(); p.partid = pId; p.partdesc = pDesc; p.productiondate = pDate; LOG.fine(new Date() + " PUT update\t" + p.toString() + "\trec=" + recId); if (recId > 0) { mParts.add(recId, p); } }
/** * Print the jMusic Part in standard output * * @param Part */ public static void internal(Part part) { System.out.println(part.toString()); }