@Override public List<IFileSpec> getOpenedFiles( final List<IFileSpec> fileSpecs, final boolean allClients, final String clientName, final int maxFiles, final int changeListId) throws ConnectionException, AccessException { try { OpenedFilesOptions openedFilesOptions = new OpenedFilesOptions( allClients, clientName, maxFiles, null, changeListId); return getOpenedFiles(fileSpecs, openedFilesOptions); } catch (final ConnectionException | AccessException exc) { throw exc; } catch (P4JavaException exc) { // TODO Why does this exception behave differently to return as // empty list? Log.warn("Unexpected exception in IServer.openedFiles: %s", exc); return Collections.emptyList(); } }
@Override public List<IFileSpec> getOpenedFiles( final List<IFileSpec> fileSpecs, final boolean allClients, final String clientName, final int maxFiles, final int changeListId) throws ConnectionException, AccessException { try { OpenedFilesOptions openedFilesOptions = new OpenedFilesOptions( allClients, clientName, maxFiles, null, changeListId); return getOpenedFiles(fileSpecs, openedFilesOptions); } catch (final ConnectionException | AccessException exc) { throw exc; } catch (P4JavaException exc) { // TODO Why does this exception behave differently to return as // empty list? Log.warn("Unexpected exception in IServer.openedFiles: %s", exc); return Collections.emptyList(); } }
/** * @see com.perforce.p4java.client.IClient#openedFiles(java.util.List, int, int) */ @Override public List<IFileSpec> openedFiles(List<IFileSpec> fileSpecs, int maxFiles, int changeListId) throws ConnectionException, AccessException { try { return this.openedFiles(fileSpecs, new OpenedFilesOptions(false, this.getName(), maxFiles, null, changeListId)); } catch (ConnectionException exc) { throw exc; } catch (AccessException exc) { throw exc; } catch (P4JavaException exc) { Log.warn("Unexpected exception in IClient.openedFiless: " + exc); return new ArrayList<IFileSpec>(); } }
/** * @see com.perforce.p4java.client.IClient#openedFiles(java.util.List, int, int) */ @Override public List<IFileSpec> openedFiles(List<IFileSpec> fileSpecs, int maxFiles, int changeListId) throws ConnectionException, AccessException { try { return this.openedFiles(fileSpecs, new OpenedFilesOptions(false, this.getName(), maxFiles, null, changeListId)); } catch (ConnectionException exc) { throw exc; } catch (AccessException exc) { throw exc; } catch (P4JavaException exc) { Log.warn("Unexpected exception in IClient.openedFiless: " + exc); return new ArrayList<IFileSpec>(); } }
/** * @see com.perforce.p4java.client.IClient#openedFiles(java.util.List, com.perforce.p4java.option.server.OpenedFilesOptions) */ @Override public List<IFileSpec> openedFiles(List<IFileSpec> fileSpecs, OpenedFilesOptions opts) throws P4JavaException { if (opts == null) { return this.serverImpl.getOpenedFiles(fileSpecs, new OpenedFilesOptions().setClientName(this.name)); } else { // Need to clone (not quite literally) the opts so we don't change the original: if (opts.getOptions() != null) { List<String> optsStrings = opts.getOptions(); return this.serverImpl.getOpenedFiles(fileSpecs, new OpenedFilesOptions( optsStrings.toArray(new String[optsStrings.size()]) )); } else { return this.serverImpl.getOpenedFiles(fileSpecs, opts.setAllClients(false).setClientName(this.getName())); } } }
/** * @see com.perforce.p4java.client.IClient#openedFiles(java.util.List, com.perforce.p4java.option.server.OpenedFilesOptions) */ @Override public List<IFileSpec> openedFiles(List<IFileSpec> fileSpecs, OpenedFilesOptions opts) throws P4JavaException { if (opts == null) { return this.serverImpl.getOpenedFiles(fileSpecs, new OpenedFilesOptions().setClientName(this.name)); } else { // Need to clone (not quite literally) the opts so we don't change the original: if (opts.getOptions() != null) { List<String> optsStrings = opts.getOptions(); return this.serverImpl.getOpenedFiles(fileSpecs, new OpenedFilesOptions( optsStrings.toArray(new String[optsStrings.size()]) )); } else { return this.serverImpl.getOpenedFiles(fileSpecs, opts.setAllClients(false).setClientName(this.getName())); } } }
OpenedFilesOptions openedFilesOptions = new OpenedFilesOptions(); List<IFileSpec> retFileSpecs = client.openedFiles( fileSpecs, openedFilesOptions );
OpenedFilesOptions openedFilesOptions = new OpenedFilesOptions(); List<IFileSpec> retFileSpecs = client.openedFiles( fileSpecs, openedFilesOptions );