Author: markt Date: Thu Oct 21 21:48:01 2010 New Revision: 1026150 URL: http://svn.apache.org/viewvc?rev=1026150&view=rev Log: Allow Checkstyle's unused imports test to be used with this class Fix Eclipse warnings Align modifyAttributes() with WARDirContext
Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=1026150&r1=1026149&r2=1026150&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java (original) +++ tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Thu Oct 21 21:48:01 2010 @@ -34,14 +34,9 @@ import javax.naming.NameClassPair; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.NamingException; -import javax.naming.NotContextException; import javax.naming.OperationNotSupportedException; -import javax.naming.directory.AttributeModificationException; import javax.naming.directory.Attributes; import javax.naming.directory.DirContext; -import javax.naming.directory.InvalidAttributesException; -import javax.naming.directory.InvalidSearchControlsException; -import javax.naming.directory.InvalidSearchFilterException; import javax.naming.directory.ModificationItem; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; @@ -359,8 +354,8 @@ public class FileDirContext extends Base * @param name the name of the context to be destroyed; may not be empty * @exception NameNotFoundException if an intermediate context does not * exist - * @exception NotContextException if the name is bound but does not name - * a context, or does not name a context of the appropriate type + * @exception javax.naming.NotContextException if the name is bound but does + * not name a context, or does not name a context of the appropriate type */ @Override public void destroySubcontext(String name) @@ -451,14 +446,14 @@ public class FileDirContext extends Base * REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTE * @param attrs the attributes to be used for the modification; may not * be null - * @exception AttributeModificationException if the modification cannot be - * completed successfully + * @exception javax.naming.directory.AttributeModificationException if the + * modification cannot be completed successfully * @exception NamingException if a naming exception is encountered */ @Override public void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException { - + throw new OperationNotSupportedException(); } @@ -472,14 +467,14 @@ public class FileDirContext extends Base * @param name the name of the object whose attributes will be updated * @param mods an ordered sequence of modifications to be performed; may * not be null - * @exception AttributeModificationException if the modification cannot be - * completed successfully + * @exception javax.naming.directory.AttributeModificationException if the + * modification cannot be completed successfully * @exception NamingException if a naming exception is encountered */ @Override public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException { - + throw new OperationNotSupportedException(); } @@ -494,8 +489,8 @@ public class FileDirContext extends Base * @param obj the object to bind; possibly null * @param attrs the attributes to associate with the binding * @exception NameAlreadyBoundException if name is already bound - * @exception InvalidAttributesException if some "mandatory" attributes - * of the binding are not supplied + * @exception javax.naming.directory.InvalidAttributesException if some + * "mandatory" attributes of the binding are not supplied * @exception NamingException if a naming exception is encountered */ @Override @@ -528,8 +523,8 @@ public class FileDirContext extends Base * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @param attrs the attributes to associate with the binding - * @exception InvalidAttributesException if some "mandatory" attributes - * of the binding are not supplied + * @exception javax.naming.directory.InvalidAttributesException if some + * "mandatory" attributes of the binding are not supplied * @exception NamingException if a naming exception is encountered */ @Override @@ -546,6 +541,7 @@ public class FileDirContext extends Base try { is = ((Resource) obj).streamContent(); } catch (IOException e) { + // Ignore } } else if (obj instanceof InputStream) { is = (InputStream) obj; @@ -605,8 +601,8 @@ public class FileDirContext extends Base * @param attrs the attributes to associate with the newly created context * @return the newly created context * @exception NameAlreadyBoundException if the name is already bound - * @exception InvalidAttributesException if attrs does not contain all - * the mandatory attributes required for creation + * @exception javax.naming.directory.InvalidAttributesException if attrs + * does not contain all the mandatory attributes required for creation * @exception NamingException if a naming exception is encountered */ @Override @@ -723,10 +719,11 @@ public class FileDirContext extends Base * (new SearchControls())). * @return an enumeration of SearchResults of the objects that satisfy * the filter; never null - * @exception InvalidSearchFilterException if the search filter specified - * is not supported or understood by the underlying directory - * @exception InvalidSearchControlsException if the search controls - * contain invalid settings + * @exception javax.naming.directory.InvalidSearchFilterException if the + * search filter specified is not supported or understood by the underlying + * directory + * @exception javax.naming.directory.InvalidSearchControlsException if the + * search controls contain invalid settings * @exception NamingException if a naming exception is encountered */ @Override @@ -755,10 +752,10 @@ public class FileDirContext extends Base * filter; never null * @exception ArrayIndexOutOfBoundsException if filterExpr contains {i} * expressions where i is outside the bounds of the array filterArgs - * @exception InvalidSearchControlsException if cons contains invalid - * settings - * @exception InvalidSearchFilterException if filterExpr with filterArgs - * represents an invalid search filter + * @exception javax.naming.directory.InvalidSearchControlsException if cons + * contains invalid settings + * @exception javax.naming.directory.InvalidSearchFilterException if + * filterExpr with filterArgs represents an invalid search filter * @exception NamingException if a naming exception is encountered */ @Override @@ -807,6 +804,7 @@ public class FileDirContext extends Base try { canPath = file.getCanonicalPath(); } catch (IOException e) { + // Ignore } if (canPath == null) return null; @@ -955,10 +953,10 @@ public class FileDirContext extends Base */ protected class FileResourceAttributes extends ResourceAttributes { + private static final long serialVersionUID = 1L; // -------------------------------------------------------- Constructor - public FileResourceAttributes(File file) { this.file = file; getCreation(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org