Project

General

Profile

« Previous | Next » 

Revision 5921

Cleaned up warnings, removed dead code.

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
33 33
import java.security.NoSuchAlgorithmException;
34 34
import java.sql.SQLException;
35 35
import java.text.DateFormat;
36
import java.text.SimpleDateFormat;
37 36
import java.util.Calendar;
38 37
import java.util.Date;
39 38
import java.util.Enumeration;
......
115 114
    
116 115
    private String metacatUrl;
117 116
    
118
    private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
119

  
120 117
    /**
121 118
     * singleton accessor
122 119
     */
......
179 176
     */
180 177
    public void setParamsFromRequest(HttpServletRequest request)
181 178
    {
182
        Enumeration paramlist = request.getParameterNames();
179
        @SuppressWarnings("unchecked")
180
        Enumeration<String> paramlist = request.getParameterNames();
183 181
        while (paramlist.hasMoreElements()) {
184 182
            String name = (String) paramlist.nextElement();
185 183
            String[] value = (String[])request.getParameterValues(name);
......
368 366
            Vector v = (Vector)h.get("access");
369 367
            for(int i=0; i<v.size(); i++)
370 368
            {
371
                Hashtable ah = (Hashtable)v.elementAt(i);
369
                @SuppressWarnings("unchecked")
370
                Hashtable<String, String> ah = (Hashtable<String, String>)v.elementAt(i);
372 371
                String principal = (String)ah.get("principal_name");
373 372
                String permission = (String)ah.get("permission");
374 373
                String permissionType = (String)ah.get("permission_type");
......
413 412
            //find the old systemmetadata (sm.old) document id (the one linked to obsoletedGuid)
414 413
            SystemMetadata sm = getSystemMetadata(token, obsoletedGuid);
415 414
            //change sm.old's obsoletedBy field 
416
            List l = sm.getObsoletedByList();
415
            List<Identifier> l = sm.getObsoletedByList();
417 416
            l.add(guid);
418 417
            sm.setObsoletedByList(l);
419 418
            //update sm.old
......
1755 1754
    /**
1756 1755
     * serialize a dataone type
1757 1756
     */
1758
    private void serializeServiceType(Class type, Object object, OutputStream out)
1759
        throws JiBXException
1760
    {
1761
        IBindingFactory bfact = BindingDirectory.getFactory(type);
1762
        IMarshallingContext mctx = bfact.createMarshallingContext();
1763
        mctx.marshalDocument(object, "UTF-8", null, out);
1764
    }
1757
//    private void serializeServiceType(Class type, Object object, OutputStream out)
1758
//        throws JiBXException
1759
//    {
1760
//        IBindingFactory bfact = BindingDirectory.getFactory(type);
1761
//        IMarshallingContext mctx = bfact.createMarshallingContext();
1762
//        mctx.marshalDocument(object, "UTF-8", null, out);
1763
//    }
1765 1764
    
1766 1765
    /**
1767 1766
     * serialize a system metadata doc
......
2014 2013
    /**
2015 2014
     * create the listObjects pathQuery document
2016 2015
     */
2017
    private String createListObjectsPathQueryDocument()
2018
        throws PropertyNotFoundException
2019
    {
2020
        String s = "<pathquery>";
2021
        s += "<returndoctype>" + PropertyService.getProperty("crudService.listObjects.ReturnDoctype") + "</returndoctype>";
2022
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.1") + "</returnfield>";
2023
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.2") + "</returnfield>";
2024
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.3") + "</returnfield>";
2025
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.4") + "</returnfield>";
2026
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.5") + "</returnfield>";
2027
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.6") + "</returnfield>";
2028
        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.7") + "</returnfield>";
2029
        s += "<querygroup operator=\"UNION\"><queryterm casesensitive=\"false\" searchmode=\"contains\">";
2030
        s += "<value>%</value>"; 
2031
        s += "<pathexpr>" + PropertyService.getProperty("crudService.listObjects.ReturnField.3") + "</pathexpr>";
2032
        s += "</queryterm></querygroup></pathquery>";
2033
  
2034
        return s;
2035
    }
2016
//    private String createListObjectsPathQueryDocument()
2017
//        throws PropertyNotFoundException
2018
//    {
2019
//        String s = "<pathquery>";
2020
//        s += "<returndoctype>" + PropertyService.getProperty("crudService.listObjects.ReturnDoctype") + "</returndoctype>";
2021
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.1") + "</returnfield>";
2022
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.2") + "</returnfield>";
2023
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.3") + "</returnfield>";
2024
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.4") + "</returnfield>";
2025
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.5") + "</returnfield>";
2026
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.6") + "</returnfield>";
2027
//        s += "<returnfield>" + PropertyService.getProperty("crudService.listObjects.ReturnField.7") + "</returnfield>";
2028
//        s += "<querygroup operator=\"UNION\"><queryterm casesensitive=\"false\" searchmode=\"contains\">";
2029
//        s += "<value>%</value>"; 
2030
//        s += "<pathexpr>" + PropertyService.getProperty("crudService.listObjects.ReturnField.3") + "</pathexpr>";
2031
//        s += "</queryterm></querygroup></pathquery>";
2032
//  
2033
//        return s;
2034
//    }
2036 2035
}
2037 2036

  

Also available in: Unified diff