public static boolean isServerFile(MappingAccessor accessor) { String typeidx = null; String clientfile = null; for (PropertyMetadata propmeta : accessor.getProperties()) { if (propmeta.getName().equalsIgnoreCase("typeidx")) { typeidx = propmeta.getValue(); } else if (propmeta.getName().equalsIgnoreCase("clientfile")) { clientfile = propmeta.getValue(); } } if (typeidx == null || clientfile != null) { return false; } if (Integer.parseInt(typeidx) == FILE_INDEX || Integer.parseInt(typeidx) == DIRECTORY_INDEX) { return true; } return false; }
public static boolean isFileUpload(MappingAccessor accessor) { String typeidx = null; String clientfile = null; for (PropertyMetadata propmeta : accessor.getProperties()) { if (propmeta.getName().equalsIgnoreCase("typeidx")) { typeidx = propmeta.getValue(); } else if (propmeta.getName().equalsIgnoreCase("clientfile")) { clientfile = propmeta.getValue(); } } if (typeidx == null || clientfile == null) { return false; } if (Integer.parseInt(typeidx) != FILE_INDEX) { return false; } if (!Utils.stringToBoolean(clientfile, false)) { return false; } return true; }