| | |
| | | import static com.forgerock.opendj.ldap.tools.ToolConstants.*; |
| | | import static com.forgerock.opendj.ldap.tools.ToolsMessages.*; |
| | | import static com.forgerock.opendj.ldap.tools.Utils.filterExitCode; |
| | | import static com.forgerock.opendj.util.StaticUtils.closeSilently; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | |
| | | return verbose.isPresent(); |
| | | } |
| | | |
| | | @SuppressWarnings("resource") |
| | | private int run(final String[] args) { |
| | | // Create the command-line argument parser for use with this |
| | | // program. |
| | |
| | | |
| | | writer = new LDIFEntryWriter(getOutputStream()); |
| | | final VisitorImpl visitor = new VisitorImpl(); |
| | | ChangeRecordReader reader = null; |
| | | try { |
| | | ChangeRecordReader reader; |
| | | if (filename.isPresent()) { |
| | | try { |
| | | reader = new LDIFChangeRecordReader(new FileInputStream(filename.getValue())); |
| | |
| | | return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue(); |
| | | } |
| | | } finally { |
| | | if (connection != null) { |
| | | connection.close(); |
| | | } |
| | | closeSilently(reader, connection); |
| | | } |
| | | |
| | | return ResultCode.SUCCESS.intValue(); |