public static String translateAttribute(String attributes) throws IOException {
  short[] flags=strAttrToBooleanFlags(attributes);
  StringBuilder sb=new StringBuilder();
  if (flags[READ_ONLY] == YES)   sb.append(" +R");
 else   if (flags[READ_ONLY] == NO)   sb.append(" -R");
  if (flags[HIDDEN] == YES)   sb.append(" +H");
 else   if (flags[HIDDEN] == NO)   sb.append(" -H");
  if (flags[SYSTEM] == YES)   sb.append(" +S");
 else   if (flags[SYSTEM] == NO)   sb.append(" -S");
  if (flags[ARCHIVE] == YES)   sb.append(" +A");
 else   if (flags[ARCHIVE] == NO)   sb.append(" -A");
  return sb.toString();
}

public static String translateAttribute ( String attributes ) throws IOException { short [ ] flags = strAttrToBooleanFlags ( attributes ) ; StringBuilder sb = new StringBuilder ( ) ; if ( flags [ READ_ONLY ] == YES ) sb . append ( " +R" ) ; else if ( flags [ READ_ONLY ] == NO ) sb . append ( " -R" ) ; if ( flags [ HIDDEN ] == YES ) sb . append ( " +H" ) ; else if ( flags [ HIDDEN ] == NO ) sb . append ( " -H" ) ; if ( flags [ SYSTEM ] == YES ) sb . append ( " +S" ) ; else if ( flags [ SYSTEM ] == NO ) sb . append ( " -S" ) ; if ( flags [ ARCHIVE ] == YES ) sb . append ( " +A" ) ; else if ( flags [ ARCHIVE ] == NO ) sb . append ( " -A" ) ; return sb . toString ( ) ; }
sets attributes of a file on windows system
