@@ -90,30 +90,30 @@ public void saveInvalidBlockToFile(
90
90
91
91
@ VisibleForTesting
92
92
protected void saveBytesToFile (
93
- final String object , final Path relativeFilePath , final Bytes bytes ) {
93
+ final String description , final Path relativeFilePath , final Bytes bytes ) {
94
94
final Path path = directory .resolve (relativeFilePath );
95
95
try {
96
96
Files .write (path , bytes .toArray ());
97
- LOG .info ("Saved {} bytes to file. Location: {}" , object , relativeFilePath );
97
+ LOG .info ("Saved {} bytes to file. Location: {}" , description , relativeFilePath );
98
98
} catch (NoSuchFileException e ) {
99
99
if (!path .getParent ().toFile ().mkdirs ()) {
100
- LOG .error ("Failed to save {} bytes to file." , object , e );
100
+ LOG .error ("Failed to save {} bytes to file." , description , e );
101
101
return ;
102
102
}
103
- saveAfterCreatingTopicDirectory (object , relativeFilePath , bytes );
103
+ saveAfterCreatingTopicDirectory (description , relativeFilePath , bytes );
104
104
} catch (IOException e ) {
105
- LOG .error ("Failed to save {} bytes to file." , object , e );
105
+ LOG .error ("Failed to save {} bytes to file." , description , e );
106
106
}
107
107
}
108
108
109
109
private void saveAfterCreatingTopicDirectory (
110
- final String object , final Path relativeFilePath , final Bytes bytes ) {
110
+ final String description , final Path relativeFilePath , final Bytes bytes ) {
111
111
final Path path = directory .resolve (relativeFilePath );
112
112
try {
113
113
Files .write (path , bytes .toArray ());
114
- LOG .info ("Saved {} bytes to file. Location: {}" , object , relativeFilePath );
114
+ LOG .info ("Saved {} bytes to file. Location: {}" , description , relativeFilePath );
115
115
} catch (IOException e ) {
116
- LOG .error ("Failed to save {} bytes to file." , object , e );
116
+ LOG .error ("Failed to save {} bytes to file." , description , e );
117
117
if (!path .getParent ().toFile ().exists ()) {
118
118
LOG .error (
119
119
"{} directory does not exist. Disabling saving debug data to file." ,
@@ -122,19 +122,20 @@ private void saveAfterCreatingTopicDirectory(
122
122
}
123
123
}
124
124
125
- private void createDirectory (final Path path , final String directoryName , final String object ) {
125
+ private void createDirectory (
126
+ final Path path , final String directoryName , final String description ) {
126
127
if (!enabled ) {
127
128
return ;
128
129
}
129
130
if (path .toFile ().mkdirs ()) {
130
- LOG .debug ("{} directory has been created to save {}." , directoryName , object );
131
+ LOG .debug ("{} directory has been created to save {}." , directoryName , description );
131
132
} else {
132
133
if (!path .toFile ().exists ()) {
133
134
this .enabled = false ;
134
135
LOG .error (
135
136
"Unable to create {} directory to save {}. Disabling saving debug data to file." ,
136
137
directoryName ,
137
- object );
138
+ description );
138
139
}
139
140
}
140
141
}
0 commit comments