Ejemplo n.º 1
0
Archivo: zip.go Proyecto: ndlib/bendo
// OpenZipWriter creates a new bundle in the given store using the given id and
// bundle number. It returns a zip writer which is then saved into the store.
func OpenZipWriter(s store.Store, id string, n int) (*Zipwriter, error) {
	f, err := s.Create(sugar(id, n))
	if err != nil {
		return nil, err
	}
	return &Zipwriter{
		f:      f,
		Writer: bagit.NewWriter(f, strings.TrimSuffix(id, ".zip")),
	}, nil
}