Example #1
0
 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;
   }
 }
Example #2
0
 /**
  * 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();
 }
Example #3
0
 @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());
 }
Example #4
0
 @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);
   }
 }
Example #5
0
 /**
  * Print the jMusic Part in standard output
  *
  * @param Part
  */
 public static void internal(Part part) {
   System.out.println(part.toString());
 }