Skip to content

Commit

Permalink
Removing CatalogFacade deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jun 1, 2019
1 parent e077156 commit 732e7b4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private <T extends CatalogInfo> T findUnique(Class<T> type, Filter filter)
throws IllegalArgumentException {

final Integer count = Integer.valueOf(2);
CloseableIterator<T> it = list(type, filter, null, count, (SortBy[]) null);
CloseableIterator<T> it = list(type, filter, null, count);
T result = null;
try {
if (it.hasNext()) {
Expand Down Expand Up @@ -818,12 +818,6 @@ public boolean canSort(Class<? extends CatalogInfo> type, String propertyName) {
return canSort;
}

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(
Class<T> of, Filter filter, Integer offset, Integer count, SortBy sortOrder) {
return list(of, filter, offset, count, sortOrder != null ? new SortBy[] {sortOrder} : null);
}

/**
* @see org.geoserver.catalog.CatalogFacade#list(java.lang.Class,
* org.geoserver.catalog.Predicate, java.lang.Integer, java.lang.Integer)
Expand Down
12 changes: 0 additions & 12 deletions src/main/src/main/java/org/geoserver/catalog/CatalogFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -691,18 +691,6 @@ default List<NamespaceInfo> getNamespacesByURI(String uri) {
*/
public boolean canSort(Class<? extends CatalogInfo> type, String propertyName);

/**
* @return an iterator over the catalog objects of the requested type that match the given
* filter
* @deprecated use {@link #list(Class, Filter, Integer, Integer, SortBy...)}
*/
public <T extends CatalogInfo> CloseableIterator<T> list(
final Class<T> of,
final Filter filter,
@Nullable Integer offset,
@Nullable Integer count,
@Nullable SortBy sortOrder);

/**
* @return an iterator over the catalog objects of the requested type that match the given
* filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ StyleInfo backupStyle(StyleInfo s) throws IOException {
// copy over the style contents
try (BufferedReader reader = catalog.getResourcePool().readStyle(s)) {
catalog.getResourcePool()
.writeStyle(backup, new ByteArrayInputStream(IOUtils.toByteArray(reader)));
.writeStyle(
backup, new ByteArrayInputStream(IOUtils.toByteArray(reader, "UTF-8")));
}
return backup;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,11 @@ public <T extends CatalogInfo> CloseableIterator<T> list(
+ sortOrder.getPropertyName()
+ " in-process sorting is pending implementation");
}
return facade.list(of, filter, offset, count, sortOrder);
if (sortOrder != null) {
return facade.list(of, filter, offset, count, sortOrder);
} else {
return facade.list(of, filter, offset, count);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1048,23 +1048,6 @@ public boolean canSort(final Class<? extends CatalogInfo> type, final String pro
throw new IllegalStateException("empty property name");
}

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(
final Class<T> of,
final Filter filter,
@Nullable Integer offset,
@Nullable Integer count,
@Nullable SortBy sortOrder) {

SortBy[] sortOrderList = null;

if (sortOrder != null) {
sortOrderList = new SortBy[] {sortOrder};
}

return list(of, filter, offset, count, sortOrderList);
}

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(
final Class<T> of,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,16 +489,6 @@ public boolean canSort(Class<? extends CatalogInfo> type, String propertyName) {
return facade.canSort(type, propertyName);
}

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(
Class<T> of,
Filter filter,
@Nullable Integer offset,
@Nullable Integer count,
@Nullable SortBy sortOrder) {
return filterIsolated(of, facade.list(of, filter, offset, count, sortOrder));
}

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(
Class<T> of,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,6 @@ public <T extends CatalogInfo> CloseableIterator<T> list(Class<T> of, Filter fil
return catalog.list(of, filter);
}

public <T extends CatalogInfo> CloseableIterator<T> list(
Class<T> of, Filter filter, Integer offset, Integer count, SortBy sortBy) {
return catalog.list(of, filter, offset, count, sortBy);
}

@Override
public <T extends StoreInfo> T detach(T store) {
return facade.detach(store);
Expand Down

0 comments on commit 732e7b4

Please sign in to comment.