@Test public void testAttributes() { Map<String, String> attributes = fileDataPacket.getAttributes(); assertEquals(tempFile.getName(), attributes.get("filename")); assertEquals(tempFile.getParentFile().getPath(), attributes.get("path")); assertEquals(tempFile.getParentFile().getAbsolutePath(), attributes.get("absolute.path")); }
@Override public Map<String, String> getAttributes() { final Map<String, String> attributes = new HashMap<>(); attributes.put("path", file.getParentFile().getPath()); attributes.put("absolute.path", file.getParentFile().getAbsolutePath()); attributes.put("filename", file.getName()); return attributes; }
FileDataPacket implements DataPacket { @Override public Map<String, String> getAttributes() { final Map<String, String> attributes = new HashMap<>(); attributes.put("path", file.getParentFile().getPath()); attributes.put("absolute.path", file.getParentFile().getAbsolutePath()); attributes.put("filename", file.getName()); return attributes; } }
FileDataPacket implements DataPacket { @Override public Map<String, String> getAttributes() { final Map<String, String> attributes = new HashMap<>(); attributes.put("path", file.getParentFile().getPath()); attributes.put("absolute.path", file.getParentFile().getAbsolutePath()); attributes.put("filename", file.getName()); return attributes; } FileDataPacket(File file); }
FileDataPacket implements DataPacket { @Override public Map<String, String> getAttributes() { final Map<String, String> attributes = new HashMap<>(); attributes.put("path", file.getParentFile().getPath()); attributes.put("absolute.path", file.getParentFile().getAbsolutePath()); attributes.put("filename", file.getName()); return attributes; } FileDataPacket(File file); @Override Map<String, String> getAttributes(); @Override InputStream getData(); @Override long getSize(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); }
FileDataPacket implements DataPacket { @Override public Map<String, String> getAttributes() { final Map<String, String> attributes = new HashMap<>(); attributes.put("path", file.getParentFile().getPath()); attributes.put("absolute.path", file.getParentFile().getAbsolutePath()); attributes.put("filename", file.getName()); return attributes; } FileDataPacket(File file); @Override Map<String, String> getAttributes(); @Override InputStream getData(); @Override long getSize(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<FileDataPacket> CREATOR; }