Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
8a856f20
Commit
8a856f20
authored
5 years ago
by
Raman Arora
Browse files
Options
Downloads
Patches
Plain Diff
5795: Reevaluate MessageAttachment class.
- Renamed members in FileAttachment class.
parent
49e47ac4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/blackboardutils/FileAttachment.java
+17
-17
17 additions, 17 deletions
...g/sleuthkit/datamodel/blackboardutils/FileAttachment.java
with
17 additions
and
17 deletions
bindings/java/src/org/sleuthkit/datamodel/blackboardutils/FileAttachment.java
+
17
−
17
View file @
8a856f20
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
*/
*/
public
final
class
FileAttachment
implements
Attachment
{
public
final
class
FileAttachment
implements
Attachment
{
private
final
String
filePathName
;
private
final
String
path
;
private
final
long
obj
Id
;
private
final
long
obj
ectID
;
// Mobile phones often create mount points to refer to SD Cards or other
// Mobile phones often create mount points to refer to SD Cards or other
// fixed/removable storage media.
// fixed/removable storage media.
...
@@ -73,18 +73,18 @@ public final class FileAttachment implements Attachment {
...
@@ -73,18 +73,18 @@ public final class FileAttachment implements Attachment {
public
FileAttachment
(
SleuthkitCase
caseDb
,
Content
dataSource
,
String
pathName
)
throws
TskCoreException
{
public
FileAttachment
(
SleuthkitCase
caseDb
,
Content
dataSource
,
String
pathName
)
throws
TskCoreException
{
//normalize the slashes.
//normalize the slashes.
this
.
filePathName
=
normalizePath
(
pathName
);
this
.
path
=
normalizePath
(
pathName
);
String
fileName
=
filePathName
.
substring
(
filePathName
.
lastIndexOf
(
'/'
)
+
1
);
String
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
);
if
(
fileName
.
isEmpty
())
{
if
(
fileName
.
isEmpty
())
{
throw
new
TskCoreException
(
String
.
format
(
"No file name specified for attachment file: %s, on data source = %d"
,
filePathName
,
dataSource
.
getId
()
));
throw
new
TskCoreException
(
String
.
format
(
"No file name specified for attachment file: %s, on data source = %d"
,
path
,
dataSource
.
getId
()
));
}
}
String
parentPathSubString
=
(
filePathName
.
lastIndexOf
(
'/'
)
<
0
)
?
""
:
filePathName
.
substring
(
0
,
filePathName
.
lastIndexOf
(
'/'
));
String
parentPathSubString
=
(
path
.
lastIndexOf
(
'/'
)
<
0
)
?
""
:
path
.
substring
(
0
,
path
.
lastIndexOf
(
'/'
));
// find the attachment file
// find the attachment file
obj
Id
=
findAttachmentFile
(
caseDb
,
fileName
,
parentPathSubString
,
dataSource
);
obj
ectID
=
findAttachmentFile
(
caseDb
,
fileName
,
parentPathSubString
,
dataSource
);
}
}
/**
/**
...
@@ -97,8 +97,8 @@ public FileAttachment(SleuthkitCase caseDb, Content dataSource, String pathName)
...
@@ -97,8 +97,8 @@ public FileAttachment(SleuthkitCase caseDb, Content dataSource, String pathName)
* @param derivedFile Derived file for the attachment.
* @param derivedFile Derived file for the attachment.
*/
*/
public
FileAttachment
(
DerivedFile
derivedFile
)
{
public
FileAttachment
(
DerivedFile
derivedFile
)
{
obj
Id
=
derivedFile
.
getId
();
obj
ectID
=
derivedFile
.
getId
();
filePathName
=
derivedFile
.
getLocalAbsPath
()
+
"/"
+
derivedFile
.
getName
();
path
=
derivedFile
.
getLocalAbsPath
()
+
"/"
+
derivedFile
.
getName
();
}
}
/**
/**
...
@@ -107,8 +107,8 @@ public FileAttachment(DerivedFile derivedFile) {
...
@@ -107,8 +107,8 @@ public FileAttachment(DerivedFile derivedFile) {
* @param abstractFile Abstract file for attachment..
* @param abstractFile Abstract file for attachment..
*/
*/
public
FileAttachment
(
AbstractFile
abstractFile
)
{
public
FileAttachment
(
AbstractFile
abstractFile
)
{
obj
Id
=
abstractFile
.
getId
();
obj
ectID
=
abstractFile
.
getId
();
filePathName
=
abstractFile
.
getParentPath
()
+
"/"
+
abstractFile
.
getName
();
path
=
abstractFile
.
getParentPath
()
+
"/"
+
abstractFile
.
getName
();
}
}
/**
/**
...
@@ -117,17 +117,17 @@ public FileAttachment(AbstractFile abstractFile) {
...
@@ -117,17 +117,17 @@ public FileAttachment(AbstractFile abstractFile) {
* @return full path name.
* @return full path name.
*/
*/
public
String
getPathName
()
{
public
String
getPathName
()
{
return
filePathName
;
return
path
;
}
}
/**
/**
* Returns the obj
Id
of the attachment file, if the file was found in the
* Returns the obj
ectID
of the attachment file, if the file was found in the
* data source.
* data source.
*
*
* @return object id of the file. -1 if no matching file is found.
* @return object id of the file. -1 if no matching file is found.
*/
*/
public
long
getObjectId
()
{
public
long
getObjectId
()
{
return
obj
Id
;
return
obj
ectID
;
}
}
/**
/**
...
@@ -245,11 +245,11 @@ private long pickBestMatchFile(List<Long> allocFileMatchesOnSameDatasource,
...
@@ -245,11 +245,11 @@ private long pickBestMatchFile(List<Long> allocFileMatchesOnSameDatasource,
@Override
@Override
public
String
getLocation
()
{
public
String
getLocation
()
{
return
this
.
filePathName
;
return
this
.
path
;
}
}
@Override
@Override
public
Long
getObjId
()
{
public
Long
getObjId
()
{
return
this
.
obj
Id
;
return
this
.
obj
ectID
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment