mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
09e52834a6
Closes #4248 // FREEBIE
29 lines
534 B
Java
29 lines
534 B
Java
package org.thoughtcrime.securesms.mms;
|
|
|
|
import android.content.ContentUris;
|
|
import android.net.Uri;
|
|
|
|
import org.thoughtcrime.securesms.attachments.AttachmentId;
|
|
|
|
public class PartUriParser {
|
|
|
|
private final Uri uri;
|
|
|
|
public PartUriParser(Uri uri) {
|
|
this.uri = uri;
|
|
}
|
|
|
|
public AttachmentId getPartId() {
|
|
return new AttachmentId(getId(), getUniqueId());
|
|
}
|
|
|
|
private long getId() {
|
|
return ContentUris.parseId(uri);
|
|
}
|
|
|
|
private long getUniqueId() {
|
|
return Long.parseLong(uri.getPathSegments().get(1));
|
|
}
|
|
|
|
}
|